in vnext/code-samples/dotnet/src/cosmosdb-vnext-test/Program.cs [112:129]
private async Task<Container> CreateContainerAsync(Database database, string containerName)
{
// Create a new container with a partition key
ContainerProperties containerProperties = new ContainerProperties
{
Id = containerName,
PartitionKeyPath = "/pk", // Note: this path must match a property in your document
IndexingPolicy = new IndexingPolicy
{
Automatic = true,
IndexingMode = IndexingMode.Consistent
}
};
ContainerResponse containerResponse = await database.CreateContainerIfNotExistsAsync(containerProperties);
Console.WriteLine($"Container created with status: {containerResponse.StatusCode}");
return containerResponse.Container;
}