Esempio n. 1
0
 public async Task Query(
     SqlQuerySpec querySpec,
     Func <List <T>, CancellationToken, Task> onReceived,
     int batchSize            = 1000,
     FeedOptions feedOptions  = null,
     CancellationToken cancel = default)
 {
     logger.LogInformation($"query: {querySpec.QueryText}");
     await docDbClient.Query(querySpec, onReceived, batchSize, feedOptions, cancel);
 }
 private async Task ReadSource(IDocDbClient src, IDocDbClient tgt, CancellationToken token)
 {
     await src.Query <DeviceRelation>(
         new SqlQuerySpec("select * from c"),
         async (list, cancel) => await UpdateDeviceRelations(tgt, list, cancel),
         10000,
         new FeedOptions()
     {
         EnableCrossPartitionQuery = true
     },
         token);
 }