Exemple #1
0
        public async Task AddCollectionAsync(ExecutionContext context)
        {
            var collection = await context.Gateway.AddCollectionAsync(
                context.Database,
                Name,
                PartitionKey,
                RequestUnits);

            await ConvergeTargetAsync(context.AddCollection(collection));
        }
Exemple #2
0
        private async Task UpdatingCollectionsAsync(
            ExecutionContext context,
            IEnumerable <DocumentCollection> toUpdate)
        {
            foreach (var coll in toUpdate)
            {
                var target = (from t in Collections
                              where t.Name == coll.Id
                              select t).First();

                Console.WriteLine($"Updating collection:  {coll.Id}");
                await target.ConvergeTargetAsync(context.AddCollection(coll));
            }
        }