Skip to content

Commit 620f5d1

Browse files
authored
Update linq-dynamic.md
1 parent 01dd9b4 commit 620f5d1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs2/pages/documentations/linq-dynamic.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var list = ctx.Where(x => "x > 2").ToList();
3333
var list = ctx.Where(x => "x > y", new { y = 2 }).ToList();
3434

3535
```
36+
{% include component-try-it.html href='https://dotnetfiddle.net/Otm0Aa' %}
3637

3738
## Order && Select
3839

@@ -48,14 +49,11 @@ All LINQ selector and order are supported. Most of them require the "Dynamic" su
4849
{% include template-example.html %}
4950
```csharp
5051

51-
var list = ctx.SelectDynamic(x => "new { y = x + 1 }").ToList();
52-
var list = ctx.SelectDynamic(x => "new { y = x + 1 }", new { y = 1 }).ToList();
53-
var list = new List<int>() { 5, 2, 4, 1, 3 };
54-
55-
var list2 = list.OrderByDynamic(x => "x + 1");
56-
var list3 = list.OrderByDynamic(x => "x + y", new { y = 1 });
52+
var list = context.Customers.OrderByDescendingDynamic(x => "x.Name").ToList();
53+
var list = context.Customers.SelectDynamic(x => "x.Name").ToList();
5754

5855
```
56+
{% include component-try-it.html href='https://dotnetfiddle.net/OJjBgK' %}
5957

6058
## Execute
6159

@@ -71,3 +69,4 @@ var list = ctx.Execute<IEnumerable<int>>("Where(x => x > 2)");
7169
var list3 = ctx.Execute("Where(x => x > y).OrderBy(x => x).ToList()", new { y = 2 });
7270

7371
```
72+
{% include component-try-it.html href='https://dotnetfiddle.net/mwTqW7' %}

0 commit comments

Comments
 (0)