Skip to content

Commit 3b1f309

Browse files
committed
Scaffold
1 parent 2aca10f commit 3b1f309

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

articles/cosmos-db/nosql/query/linq-to-sql.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
---
2-
title: LINQ to SQL translation in Azure Cosmos DB
2+
title: LINQ to SQL translation
3+
titleSuffix: Azure Cosmos DB for NoSQL
34
description: Learn the LINQ operators supported and how the LINQ queries are mapped to SQL queries in Azure Cosmos DB.
45
author: seesharprun
6+
ms.author: sidandrews
7+
ms.reviewer: jucocchi
58
ms.service: cosmos-db
69
ms.subservice: nosql
7-
ms.custom: ignite-2022
810
ms.topic: conceptual
9-
ms.date: 08/06/2021
10-
ms.author: sidandrews
11-
ms.reviewer: jucocchi
11+
ms.date: 03/22/2023
12+
ms.custom: ignite-2022
1213
---
13-
# LINQ to SQL translation
14+
15+
# LINQ to SQL translation in Azure Cosmos DB for NoSQL
16+
1417
[!INCLUDE[NoSQL](../../includes/appliesto-nosql.md)]
1518

1619
The Azure Cosmos DB query provider performs a best effort mapping from a LINQ query into an Azure Cosmos DB SQL query. If you want to get the SQL query that is translated from LINQ, use the `ToString()` method on the generated `IQueryable`object. The following description assumes a basic familiarity with [LINQ](/dotnet/csharp/programming-guide/concepts/linq/introduction-to-linq-queries). In addition to LINQ, Azure Cosmos DB also supports [Entity Framework Core](/ef/core/providers/cosmos/?tabs=dotnet-core-cli) which works with API for NoSQL.
@@ -26,7 +29,7 @@ The query provider supports the following scalar expressions:
2629

2730
- Property/array index expressions that refer to the property of an object or an array element. For example:
2831

29-
```
32+
```csharp
3033
family.Id;
3134
family.children[0].familyName;
3235
family.children[0].grade;
@@ -35,21 +38,21 @@ The query provider supports the following scalar expressions:
3538

3639
- Arithmetic expressions, including common arithmetic expressions on numerical and Boolean values. For the complete list, see the [Azure Cosmos DB SQL specification](aggregate-functions.md).
3740

38-
```
41+
```csharp
3942
2 * family.children[0].grade;
4043
x + y;
4144
```
4245

4346
- String comparison expressions, which include comparing a string value to some constant string value.
4447

45-
```
48+
```csharp
4649
mother.familyName == "Wakefield";
4750
child.givenName == s; //s is a string variable
4851
```
4952

5053
- Object/array creation expressions, which return an object of compound value type or anonymous type, or an array of such objects. You can nest these values.
5154

52-
```
55+
```csharp
5356
new Parent { familyName = "Wakefield", givenName = "Robin" };
5457
new { first = 1, second = 2 }; //an anonymous type with two fields
5558
new int[] { 3, child.grade, 5 };
@@ -76,7 +79,7 @@ using (FeedIterator<Book> setIterator = container.GetItemLinqQueryable<Book>()
7679
}
7780
```
7881

79-
## <a id="SupportedLinqOperators"></a>Supported LINQ operators
82+
## Supported LINQ operators
8083

8184
The LINQ provider included with the SQL .NET SDK supports the following operators:
8285

0 commit comments

Comments
 (0)