Snippets | Azure Cosmos DB
Consultar una base de datos Azure Cosmos DB
1 2 |
Database database = client.CreateDatabaseQuery().Where(db => db.Id == databaseId).AsEnumerable().FirstOrDefault(); Console.WriteLine("1. Query for a database returned: {0}", database==null?"no results":database.Id); |
Crear una base de datos Azure Cosmos DB
1 2 3 4 5 6 7 8 |
Database database = client.CreateDatabaseQuery().Where(db => db.Id == databaseId).AsEnumerable().FirstOrDefault(); Console.WriteLine("1. Query for a database returned: {0}", database==null?"no results":database.Id); if (database==null) { database = await client.CreateDatabaseAsync(new Database { Id = databaseId }); Console.WriteLine("\n2. Created Database: id - {0} and selfLink - {1}", database.Id, database.SelfLink); } |
Leer una base de datos Azure Cosmos […]