示例#1
0
        protected async override Task ProcessTableAsync()
        {
            await CreatePullStrategy();

            QueryResult result;

            do
            {
                this.CancellationToken.ThrowIfCancellationRequested();

                string query = this.Query.ToODataString();
                if (this.Query.UriPath != null)
                {
                    query = MobileServiceUrlBuilder.CombinePathAndQuery(this.Query.UriPath, query);
                }
                result = await this.Table.ReadAsync(query, MobileServiceTable.IncludeDeleted(parameters), this.Table.Features);

                await this.ProcessAll(result.Values); // process the first batch

                result = await FollowNextLinks(result);
            }
            // if we are not at the end of result and there is no link to get more results
            while (!this.EndOfResult(result) && await this.strategy.MoveToNextPageAsync());

            await this.strategy.PullCompleteAsync();
        }
 /// <summary>
 /// Ensure the query will get the deleted records. This requires the soft delete feature to be enabled on the Mobile Service. Visit <see href="http://go.microsoft.com/fwlink/?LinkId=507647">the link</see> for details.
 /// </summary>
 /// <returns>
 /// The query object.
 /// </returns>
 public IMobileServiceTableQuery <T> IncludeDeleted()
 {
     return(this.QueryProvider.Create(this.Table, this.Query, MobileServiceTable.IncludeDeleted(this.Parameters), includeTotalCount: true));
 }