You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Description("This sample uses FirstOrDefault to try to return the first element of the sequence unless there are no elements, in which case the default value for that type is returned. FirstOrDefault is useful for creating outer joins.")]
43
+
[Description("This sample returns the first or default if nothing is found, to try to return the first element of the sequence unless there are no elements, in which case the default value for that type is returned.")]
44
44
staticvoidLinq61()
45
45
{
46
46
varnumbers=newint[0];
@@ -51,7 +51,7 @@ static void Linq61()
51
51
}
52
52
53
53
[Category("Element Operators")]
54
-
[Description("This sample uses FirstOrDefault to return the first product whose ProductID is 789 as a single Product object, unless there is no match, in which case null is returned.")]
54
+
[Description("This sample returns the first or default if nothing is found, to return the first product whose ProductID is 789 as a single Product object, unless there is no match, in which case null is returned.")]
55
55
staticvoidLinq62()
56
56
{
57
57
varproducts=GetProductList();
@@ -62,7 +62,7 @@ static void Linq62()
62
62
}
63
63
64
64
[Category("Element Operators")]
65
-
[Description("This sample uses ElementAt to retrieve the second number greater than 5 from an array.")]
65
+
[Description("This sample retrieve the second number greater than 5 from an array.")]
Copy file name to clipboardExpand all lines: src/csharp/linq-generation/Program.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ static void Main(string[] args)
14
14
}
15
15
16
16
[Category("Generation Operators")]
17
-
[Description("This sample uses Range to generate a sequence of numbers from 100 to 149 that is used to find which numbers in that range are odd and even.")]
17
+
[Description("This sample uses generates a sequence of numbers from 100 to 149 that is used to find which numbers in that range are odd and even.")]
18
18
staticvoidLinq65()
19
19
{
20
20
varnumbers=Enumerable.Range(100,50)
@@ -29,7 +29,7 @@ static void Linq65()
29
29
}
30
30
31
31
[Category("Generation Operators")]
32
-
[Description("This sample uses Repeat to generate a sequence that contains the number 7 ten times.")]
32
+
[Description("This sample uses generates a sequence of repeated numbers that contains the number 7 ten times.")]
[Description("This sample uses group by to partition a list of products by category.")]
87
-
privatestaticvoidLinq42()
86
+
[Description("This sample uses grouping to partition a list of products by category.")]
87
+
staticvoidLinq42()
88
88
{
89
89
varproducts=GetProductList();
90
90
@@ -101,8 +101,8 @@ private static void Linq42()
101
101
}
102
102
103
103
[Category("Grouping Operators")]
104
-
[Description("This sample uses group by to partition a list of each customer's orders, first by year, and then by month.")]
105
-
privatestaticvoidLinq43()
104
+
[Description("This sample uses nested grouping to partition a list of each customer's orders, first by year, and then by month.")]
105
+
staticvoidLinq43()
106
106
{
107
107
varcustomers=GetCustomerList();
108
108
@@ -136,7 +136,7 @@ private static void Linq43()
136
136
137
137
[Category("Grouping Operators")]
138
138
[Description("This sample uses GroupBy to partition trimmed elements of an array using a custom comparer that matches words that are anagrams of each other.")]
139
-
privatestaticvoidLinq44()
139
+
staticvoidLinq44()
140
140
{
141
141
varanagrams=new[]{"from "," salt"," earn "," last "," near "," form "};
142
142
varorderGroups=anagrams
@@ -147,7 +147,7 @@ private static void Linq44()
147
147
148
148
[Category("Grouping Operators")]
149
149
[Description("This sample uses GroupBy to partition trimmed elements of an array using a custom comparer that matches words that are anagrams of each other, and then converts the results to uppercase.")]
150
-
privatestaticvoidLinq45()
150
+
staticvoidLinq45()
151
151
{
152
152
varanagrams=new[]{"from "," salt"," earn "," last "," near "," form "};
Copy file name to clipboardExpand all lines: src/csharp/linq-ordering/Program.cs
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ static void Main(string[] args)
25
25
26
26
27
27
[Category("Ordering Operators")]
28
-
[Description("This sample uses orderby to sort a list of words alphabetically.")]
28
+
[Description("This sample uses ordering to sort a list of words alphabetically.")]
29
29
staticvoidLinq28()
30
30
{
31
31
varwords=new[]{"cherry","apple","blueberry"};
@@ -37,7 +37,7 @@ static void Linq28()
37
37
}
38
38
39
39
[Category("Ordering Operators")]
40
-
[Description("This sample uses orderby to sort a list of words by length.")]
40
+
[Description("This sample uses ordering to sort a list of words by length.")]
41
41
staticvoidLinq29()
42
42
{
43
43
varwords=new[]{"cherry","apple","blueberry"};
@@ -49,7 +49,7 @@ static void Linq29()
49
49
}
50
50
51
51
[Category("Ordering Operators")]
52
-
[Description("This sample uses orderby to sort a list of products by name. Use the \"descending\" keyword at the end of the clause to perform a reverse ordering.")]
52
+
[Description("This sample uses ordering to sort a list of products by name.")]
53
53
staticvoidLinq30()
54
54
{
55
55
varproducts=GetProductList();
@@ -60,7 +60,7 @@ static void Linq30()
60
60
}
61
61
62
62
[Category("Ordering Operators")]
63
-
[Description("This sample uses an OrderBy clause with a custom comparer to do a case-insensitive sort of the words in an array.")]
63
+
[Description("This sample uses case-insensitive ordering to sort the words in an array.")]
[Description("The first query in this sample uses OrderBy and ThenBy with a custom comparer to sort first by word length and then by a case-insensitive sort of the words in an array.")]
122
+
[Description("This sample uses case-insensitive nested ordering, with a custom comparer to sort first by word length and then by a case-insensitive sort of the words in an array.")]
[Description("This sample uses OrderBy and ThenByDescendingo sort a list of products, first by category, and then by unit price, from highest to lowest.")]
135
+
[Description("This sample uses nested ordering to sort a list of products, first by category, and then by unit price, from highest to lowest.")]
136
136
staticvoidLinq37()
137
137
{
138
138
varproducts=GetProductList();
@@ -145,7 +145,7 @@ static void Linq37()
145
145
}
146
146
147
147
[Category("Ordering Operators")]
148
-
[Description("This sample uses an OrderBy and a ThenBy clause with a custom comparer to sort first by word length and then by a case-insensitive descending sort of the words in an array.")]
148
+
[Description("This sample uses uses case-insensitive reverse nested ordering to sort first by word length and then by a case-insensitive descending sort of the words in an array.")]
[Description("This sample uses Reverse to create a list of all digits in the array whose second letter is 'i' that is reversed from the order in the original array.")]
161
+
[Description("This sample uses reverse ordering to create a list of all digits in the array whose second letter is 'i' that is reversed from the order in the original array.")]
0 commit comments