Exemplo n.º 1
0
        public async Task OneTimeSetUp()
        {
            _client = new DocumentClient(new Uri("https://localhost:8081"), "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==");

            var database = await _client.CreateDatabaseIfNotExistsAsync(new Microsoft.Azure.Documents.Database {
                Id = "CosmosSelectManyRepro"
            });

            _database = database.Resource;

            var collection = await _client.CreateDocumentCollectionIfNotExistsAsync(_database.SelfLink, new Microsoft.Azure.Documents.DocumentCollection {
                Id = "Documents"
            });

            _collection = collection.Resource;

            await _client.UpsertDocumentAsync(_collection.SelfLink, BobContainer);

            await _client.UpsertDocumentAsync(_collection.SelfLink, KristineContainer);
        }
Exemplo n.º 2
0
        public async Task <IAccount> AddAsync(Microsoft.Azure.Documents.Database database)
        {
            await Client.CreateDatabaseAsync(database);

            return(this);
        }
Exemplo n.º 3
0
 public IAccount Add(Microsoft.Azure.Documents.Database database)
 {
     return(Helpers.Synchronize(this.AddAsync(database)));
 }
Exemplo n.º 4
0
 public async Task <IDatabase> CreateAsync(Microsoft.Azure.Documents.Database database)
 {
     this.Id = (await Client.CreateDatabaseIfNotExistsAsync(database, _requestOptions)).Resource.Id;
     return(this);
 }
Exemplo n.º 5
0
 public IDatabase Create(Microsoft.Azure.Documents.Database database)
 {
     return(Helpers.Synchronize(this.CreateAsync(database)));
 }
Exemplo n.º 6
0
 public DocumentDBContext()
 {
     var database = new Microsoft.Azure.Documents.Database();
 }