Skip to content

Commit 9c52e20

Browse files
authored
Merge pull request #208704 from seesharprun/aug22-table-dotnet-cosmos-fix
Cosmos DB | Fix bugs in Table API + .NET Quickstart
2 parents 5941462 + d62eb24 commit 9c52e20

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

articles/cosmos-db/table/create-table-dotnet.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ ms.service: cosmos-db
77
ms.subservice: cosmosdb-table
88
ms.devlang: dotnet
99
ms.topic: quickstart
10-
ms.date: 06/24/2022
10+
ms.date: 08/22/2022
1111
ms.custom: devx-track-dotnet
1212
---
1313

1414
# Quickstart: Azure Cosmos DB Table API for .NET
15+
1516
[!INCLUDE[appliesto-table-api](../includes/appliesto-table-api.md)]
1617

1718
This quickstart shows how to get started with the Azure Cosmos DB Table API from a .NET application. The Cosmos DB Table API is a schemaless data store allowing applications to store structured NoSQL data in the cloud. You'll learn how to create tables, rows, and perform basic tasks within your Cosmos DB resource using the [Azure.Data.Tables Package (NuGet)](https://www.nuget.org/packages/Azure.Data.Tables/).
@@ -24,7 +25,7 @@ This quickstart shows how to get started with the Azure Cosmos DB Table API from
2425
## Prerequisites
2526

2627
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
27-
* [.NET 6.0](https://dotnet.microsoft.com/en-us/download)
28+
* [.NET 6.0](https://dotnet.microsoft.com/download)
2829
* [Azure Command-Line Interface (CLI)](/cli/azure/) or [Azure PowerShell](/powershell/azure/)
2930

3031
### Prerequisite check
@@ -34,7 +35,7 @@ This quickstart shows how to get started with the Azure Cosmos DB Table API from
3435

3536
## Setting up
3637

37-
This section walks you through how to create an Azure Cosmos account and set up a project that uses the Table API NuGet packages.
38+
This section walks you through how to create an Azure Cosmos account and set up a project that uses the Table API NuGet packages.
3839

3940
### Create an Azure Cosmos DB account
4041

@@ -72,10 +73,10 @@ This quickstart will create a single Azure Cosmos DB account using the Table API
7273

7374
### Create a new .NET app
7475

75-
Create a new .NET application in an empty folder using your preferred terminal. Use the [``dotnet new console``](/dotnet/core/tools/dotnet-new) to create a new console app.
76+
Create a new .NET application in an empty folder using your preferred terminal. Use the [``dotnet new console``](/dotnet/core/tools/dotnet-new) to create a new console app.
7677

7778
```console
78-
dotnet new console -output <app-name>
79+
dotnet new console --output <app-name>
7980
```
8081

8182
### Install the NuGet package
@@ -102,9 +103,9 @@ The sample code described in this article creates a table named ``adventureworks
102103

103104
You'll use the following Table API classes to interact with these resources:
104105

105-
- [``TableServiceClient``](/dotnet/api/azure.data.tables.tableserviceclient) - This class provides methods to perform service level operations with Azure Cosmos DB Table API.
106-
- [``TableClient``](/dotnet/api/azure.data.tables.tableclient) - This class allows you to interact with tables hosted in the Azure Cosmos DB table API.
107-
- [``TableEntity``](/dotnet/api/azure.data.tables.tableentity) - This class is a reference to a row in a table that allows you to manage properties and column data.
106+
* [``TableServiceClient``](/dotnet/api/azure.data.tables.tableserviceclient) - This class provides methods to perform service level operations with Azure Cosmos DB Table API.
107+
* [``TableClient``](/dotnet/api/azure.data.tables.tableclient) - This class allows you to interact with tables hosted in the Azure Cosmos DB table API.
108+
* [``TableEntity``](/dotnet/api/azure.data.tables.tableentity) - This class is a reference to a row in a table that allows you to manage properties and column data.
108109

109110
### Authenticate the client
110111

@@ -128,7 +129,7 @@ The easiest way to create a new item in a table is to create a class that implem
128129

129130
:::code language="csharp" source="~/azure-cosmos-tableapi-dotnet/001-quickstart/Product.cs" id="type" :::
130131

131-
Create an item in the collection using the `Product` class by calling [``TableClient.AddEntityAsync<T>``](/dotnet/api/azure.data.tables.tableclient.addentityasync).
132+
Create an item in the collection using the `Product` class by calling [``TableClient.AddEntityAsync<T>``](/dotnet/api/azure.data.tables.tableclient.addentityasync).
132133

133134
:::code language="csharp" source="~/azure-cosmos-tableapi-dotnet/001-quickstart/Program.cs" id="create_object_add" :::
134135

@@ -140,7 +141,7 @@ You can retrieve a specific item from a table using the [``TableEntity.GetEntity
140141

141142
### Query items
142143

143-
After you insert an item, you can also run a query to get all items that match a specific filter by using the `TableClient.Query<T>` method. This example filters products by category using [Linq](/dotnet/standard/linq) syntax, which is a benefit of using strongly typed `ITableEntity` models like the `Product` class.
144+
After you insert an item, you can also run a query to get all items that match a specific filter by using the `TableClient.Query<T>` method. This example filters products by category using [Linq](/dotnet/standard/linq) syntax, which is a benefit of using typed `ITableEntity` models like the `Product` class.
144145

145146
> [!NOTE]
146147
> You can also query items using [OData](/rest/api/storageservices/querying-tables-and-entities) syntax. You can see an example of this approach in the [Query Data](./tutorial-query-table.md) tutorial.

articles/cosmos-db/table/includes/quickstart-dotnet/azure-cli-get-connection-string.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ author: alexwolfmsft
33
ms.service: cosmos-db
44
ms.subservice: cosmosdb-table
55
ms.topic: include
6-
ms.date: 07/08/2022
6+
ms.date: 08/22/2022
77
ms.author: alexwolf
88
---
99
1. Find the Table API **connection string** from the list of connection strings for the account with the [``az cosmosdb list-connection-strings``](/cli/azure/cosmosdb#az-cosmosdb-list-connection-strings) command.
@@ -14,4 +14,4 @@ ms.author: alexwolf
1414
--name $accountName
1515
```
1616
17-
1. Record the *PRIMARY KEY* values. You'll use these credentials later.
17+
1. Record the *Primary Table Connection String* values. You'll use these credentials later.

0 commit comments

Comments
 (0)