Skip to content

Commit 26a27f2

Browse files
committed
update to add container to tab
1 parent ba82ec6 commit 26a27f2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

articles/cosmos-db/nosql/quickstart-dotnet.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ Use the [``CosmosClient.GetDatabase``](/dotnet/api/microsoft.azure.cosmos.cosmos
193193

194194
:::code language="csharp" source="~/cosmos-db-nosql-dotnet-samples/002-quickstart-passwordless/Program.cs" id="new_database" highlight="2,4":::
195195

196+
### Get the container
197+
198+
The [``Database.GetContainer``](/dotnet/api/microsoft.azure.cosmos.database.getcontainer) will return a reference to the specified container.
199+
200+
:::code language="csharp" source="~/cosmos-db-nosql-dotnet-samples/002-quickstart-passwordless/Program.cs" id="new_container" highlight="2,4":::
201+
196202
## [Connection String](#tab/connection-string)
197203

198204
### Create a database
@@ -203,14 +209,16 @@ Use the [``CosmosClient.CreateDatabaseIfNotExistsAsync``](/dotnet/api/microsoft.
203209

204210
For more information on creating a database, see [Create a database in Azure Cosmos DB for NoSQL using .NET](how-to-dotnet-create-database.md).
205211

206-
---
207212

208213
### Get the container
209214

210215
The [``Database.GetContainer``](/dotnet/api/microsoft.azure.cosmos.database.getcontainer) will return a reference to the specified container.
211216

212217
:::code language="csharp" source="~/cosmos-db-nosql-dotnet-samples/002-quickstart-passwordless/Program.cs" id="new_container" highlight="2,4":::
213218

219+
220+
---
221+
214222
### Create an item
215223

216224
The easiest way to create a new item in a container is to first build a C# [class](/dotnet/csharp/language-reference/keywords/class) or [record](/dotnet/csharp/language-reference/builtin-types/record) type with all of the members you want to serialize into JSON. In this example, the C# record has a unique identifier, a *categoryId* field for the partition key, and extra *categoryName*, *name*, *quantity*, and *sale* fields.

0 commit comments

Comments
 (0)