Created
October 3, 2021 15:49
-
-
Save cdennig/368d2dc9359991e7a308de4a8f1e8d35 to your computer and use it in GitHub Desktop.
usage.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var credential = new DefaultAzureCredential(); | |
var cosmosClient = new CosmosClient(_configuration["Cosmos:Uri"], credential); | |
var container = cosmosClient.GetContainer(_configuration["Cosmos:Db"], _configuration["Cosmos:Container"]); | |
var newId = Guid.NewGuid().ToString(); | |
await container.CreateItemAsync(new {id = newId, partitionKey = newId, name = "Ted Lasso"}, | |
new PartitionKey(newId), cancellationToken: stoppingToken); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment