-
Notifications
You must be signed in to change notification settings - Fork 0
ephemerally.azure.cosmos
Colton Fussy edited this page Jun 21, 2024
·
3 revisions
dotnet add package Ephemerally.Azure.Cosmos
// Create a new ephemeral database with a random name
await using var randomDatabase = cosmosClient.CreateEphemeralDatabaseAsync();
// Make an existing database ephemeral
Database existingDatabase = cosmosClient.GetDatabase("myCoolDatabase");
await using var ephemeralExistingDatabase.ToEphemeral();
// Create a new ephemeral container with a random name
await using var randomContainer = cosmosDatabase.CreateEphemeralContainerAsync();
// Make an existing container ephemeral
Container existingContainer = cosmosDatabase.GetContainer("myCoolContainer");
await using var ephemeralExistingContainer.ToEphemeral();