我正在尝试从同步表中创建过去 10 天的“新增内容”类型的列表。
我不想同步整个表,因为它包含数万行或过去 10 天具有 CreatedAt
的行。
await App.syncTablePersonStringChange.PullAsync(
"whtsnew",
App.syncTablePersonStringChange.Where(x=>DateTimeOffset.UtcNow.Subtract(x.CreatedAt) <= TimeSpan.FromDays(10)),
false,
new CancellationToken(),
new PullOptions());
我已经尝试了上面的代码,但是需要很长时间(永远不会完成)。
没有错误。
最佳答案
问题在于您的 where 语句。我已尝试过您的声明,但收到 NotSupportException:
System.NotSupportedException: The member 'Subtract' is not supported in the 'Where' Mobile Services query expression.
这对我有用:
.Where(x => x.CreatedAt >= DateTimeOffset.UtcNow.AddDays(-10));
但在此语句中,CreatedAt
的偏移将被忽略...
关于c# - 仅具有过去 10 天脱机同步 PullAsync 行的 MobileServiceClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45002396/