I would like to show you the anonymous types with linq in c#.
Let's say we have an array and we would like to use linq.
var num = new int[] {0, 1, 2, 3, 4, 5};
var q = from n in num select n;
foreach (var n in q)
Console.WriteLine(n);
The output will be:-
0
1
2
3
4
5
and if you want to see them in reverse order.
var q = from n in num orderby n descending select n;
Now, the output will be:-
5
4
3
2
1
0