Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
C#
LINQ 299 codes
Home
C#
LINQ
1 A deferred execution query is reevaluated when you reenumerate
2 A lambda expression can reference the local variables and parameters of the method in which its defined
3 A lambda expression has the following BNF form
4 A local variable instantiated within a lambda expression is unique per invocation of the delegate instance
5 A More Complex Example of the First SelectMany
6 A query to extract strings containing the letter a, sorted by length and converted to uppercase
7 A Query Using the Standard Dot Notation Syntax
8 A subquery is a query contained within another querys lambda expression
9 Add Extension method
10 Aggregate and Sum
11 Aggregate Prototype
12 All employees in a tree are grouped by department
13 All with condition
14 All with Predicate to Return True
15 All with string length
16 An Anonymous Type Assigned to a Variable Declared with the var Keyword
17 An array of string values sorted first by length, then sorted alphabetically, using a case-insentive comparison
18 An Example Calling the Reverse Operator
19 An Example of Collection Initialization
20 An untidy nested query
21 Anonymous Types
22 Any operator with an string array
23 Any with condition
24 Any with false predicate
25 Any with string operator
26 Assign the loop variable to another variable declared inside the statement block
27 Average with int array
28 Call ILookUp returned from ToLookup to get the IEnumerable
29 Call LastOrDefault returned from Take
30 Calling the Common Library Filter Method
31 Calling the ElementAt Operator
32 Calling the Filter Method with a Lambda Expression
33 Calling the Filter Method with an Anonymous Method
34 Calling the First ToDictionary Prototype
35 Calling the Range Operator
36 Calling the ToArray Operator
37 Calling the ToList Operator
38 Calling ToList
39 Chaining Query Operatorsextracts all strings containing the letter a, sorts them by length, and then converts the results to uppercas
40 Compound from
41 Concat appends one sequence to another
42 Concat Prototype
43 Concatention by Using the Concat Operator
44 Conditional Count
45 Constructor new object with select statement
46 Contains with IEqualityComparer
47 Contains with predicate returned false
48 Contains with string value
49 Contains with string value and IEqualityComparer
50 Contains, Any return a bool value
51 Convert an ArrayList to an IEnumerableT That Can Be Used with the Typical Standard Query Operators
52 Convert Query result to a List
53 Convert query result to an Array
54 Convert query to array with ToArray
55 Convert query to Dictionary
56 Converting an Array of Strings to Integers
57 Converting an Array of Strings to Integers and Sorting It
58 Count with string operator
59 Count with string value
60 Decode Member Access Expression
61 DefaultIfEmpty Demo
62 Deferred Query Execution
63 Demonstrating the Query Results Changing Between Enumerations
64 Display Linq result in a DataGridView
65 Distinct Operator
66 ElementAtOrDefault Operator with a Valid Index
67 ElementAtOrDefault Operator with an Invalid Index
68 Except Prototype
69 Extension method for integer
70 Extension Methods Discoverability
71 Filter string by its length
72 Filtered
73 First Min Prototype
74 First operator
75 First OrderBy Prototype
76 First OrderByDescending Prototype
77 First Select Prototype
78 First ThenBy Prototype
79 First ThenByDescending Prototype
80 First with string method
81 FirstOrDefault
82 FirstOrDefault returns null when an Element Is Found
83 FirstOrDefault with a Not Found Element
84 FirstOrDefault with Condition
85 FirstOrDefault with string operator
86 From Assignment
87 Generates an array of double values by first using a query expression with orderby
88 Get Distinct departments
89 Get Distinct departments with condition
90 Get Member Name
91 Get the Min and max value from a query
92 Group words by length
93 GroupBy partitions a list of numbers by their remainder when divided by 5
94 Grouped Average
95 Grouped Max
96 Grouped Min
97 Grouped Sum
98 GroupJoin Operator
99 How queries can be executed immediately with operators such as ToList()
100 If your querys lambda expressions reference local variables, these variables are subject to outer variable semantics
101 Immediate Query Execution
102 Instantiating and Initializing an Anonymous Type Using Object Initialization
103 Intersect Operator
104 Join Operator
105 Join three object list
106 Join two object lists
107 Lambda expression used to declare a delegate
108 Lambda expression used to declare an expression tree
109 Last Prototype
110 Last with string operator
111 LastOrDefault
112 LastOrDefault returns null when an Element Is Found
113 LastOrDefault with string operator
114 Linq Reflection
115 LongCount Prototype
116 LongCount with &&(and) operator
117 Max on int array
118 Max on object list
119 Max on Object list array
120 Max on String array
121 Min with object property
122 Min with string property value
123 Min with string value
124 Most query operators is that they execute not when constructed, but when enumerated
125 Multiple from
126 Nested Count
127 Nested query list
128 Nested Skip
129 Nested Take
130 Object Initializer
131 OfType
132 One array expect another array
133 OrderBy
134 OrderBy with customized Comparer
135 OrderBy with passing a lambda function
136 Partitioning Operators
137 Partitions an array of words into groups according to the first letter of each word
138 Prints a list of numbers that are common to two integer arrays
139 Prints all of the elements of an array that are of type double
140 Prints strings where each element has the second letter i
141 Prints the customer number and orderID for every order in the list
142 Prints the first letter of a Product name and the first letter of a Customer name
143 Prints the unique Category names
144 Prints the unique elements of two integer arrays
145 Prints unique letters from Product and Customer names
146 Products sorted alphabetically by the product name
147 Products sorted by the number of units of each product that are in stock
148 Projection Operators
149 Query a list of objects by its property
150 Query a List or objects and create new objects
151 Query an array of object by its property value
152 Query by Persons FirstName
153 Query by position
154 Query Reuse
155 Query string value by String StartsWith
156 Query Using the Query Expression Syntax
157 Query with an Exception
158 Query with Intentional Exception Deferred Until Enumeration
159 Restriction Operators
160 Retrieves all strings in an array whose length matches that of the shortest string
161 Return a lambda function
162 Return an Empty Sequence of Strings
163 Returning a List
164 Returning a Sequence of Ten Integers All With the Value Two
165 Reverse does exactly as it says
166 Second Select Prototype
167 Second SkipWhile Prototype
168 Second ToDictionary
169 Select - Indexed
170 Select array item by type
171 Select from a Group
172 Select new
173 Select object in a List
174 Select Prototype
175 Select with Anonymous Types
176 SelectMany Prototype
177 SequenceEqual Operator
178 SequenceEqual Operator with string array
179 SequenceEqual Operator with Take and Count
180 SequenceEqual Operator with Take, Concat and Skip
181 Set Operators
182 Shows how queries can be reused
183 Single with condition
184 Single with object list
185 SingleOrDefault
186 SingleOrDefault after where clause
187 SingleOrDefault with object property reference
188 Skip the first element
189 SkipWhile Prototype
190 SkipWhile with condition
191 SkipWhile with index
192 Sorted alphabetically in descending order, using a case insensitive comparision
193 Square is assigned the lambda expression x = x x
194 String array sorted by the length each element
195 Sum with integers
196 Sum with object property
197 Sum with Projection
198 Take and SelectMany
199 Take method
200 Take operator outputs the first x elements, discarding the rest
201 TakeWhile with condition
202 TakeWhile with expresion
203 TakeWhile with two parameters
204 The aggregation operators return a scalar value
205 The element operators extract one element from the input sequence
206 The Skip operator ignores the first x elements and outputs the rest
207 The standard object creation and initialization vs Linq
208 To List
209 To remove all vowels from a string
210 ToDictionary
211 ToDictionary for an object list
212 ToDictionary with IEqualityComparer
213 ToLookup Demo
214 ToLookup with int and string
215 Transformation
216 Two where clauses
217 Union does appends one sequence to another with duplicates removed
218 Union Operator
219 Use && in where clause
220 Use Aggregate on an array
221 Use Aggregate on an array with tenary operator
222 Use Aggregate Operators
223 Use an indexed Where clause (where the length of the numbers name is shorter than its value)
224 Use Average method to calculate the average value from a query
225 Use Concat to merge two integer arrays into a single sequence
226 Use Concat with array elements
227 Use Contains to check the existance of an element
228 Use Contains, Length and ToUpper from Linq
229 Use Conversion Operators ToArray
230 Use delegate to create a filter
231 Use ElementAt
232 Use ElementAt to print the fourth number less that 5 in an integer array
233 Use ElementAtOrDefault
234 Use Equal determines if two string arrays have the same elements in the same order
235 Use Except to print numbers that are in one integer array, but not another
236 Use Except to print the first character of product names that arent also the first character of customer names
237 Use First to return the first matching element as a Product
238 Use First, Last with expression
239 Use FirstOrDefault
240 Use foreach loop to deal with the result from linq
241 Use from where select to choose the Employees in the IT department from a tree
242 Use Generation Operators
243 Use Group By
244 Use group to group all employees by department
245 Use index when querying array with LINQ
246 Use join key word
247 Use Join on
248 Use LastOrDefault
249 Use LINQ to get Employees in the IT department from a tree
250 Use LINQ to query characters in a string
251 Use LINQ to SQL
252 Use LINQ with Dictionary
253 Use Linq Cast to convert array to IEnumerable
254 Use Linq Distinct to get the distinct value in an array
255 Use Linq Intersect to intersect two arrays
256 Use Linq OfType to get value of specific type
257 Use Linq Sum to sum an array
258 Use Linq to union two arrays
259 Use Min to get the lowest number in an integer array
260 Use Quantifiers
261 Use select to retrieve all nodes in a Binary tree
262 Use Single
263 Use SingleOrDefault
264 Use Skip
265 Use SkipWhile with index
266 Use static method syntax to call the query operators
267 Use string method in where clause
268 Use Sum to find the total of all of the numbers in an integer array
269 Use Take
270 Use TakeWhile with index
271 Use ToLookup to search object property
272 Use where clause in a while loop
273 Use where to filer object list
274 Uses a compound from clause to select all orders where the order was made in 1998 or later
275 Uses a compound orderby to sort a list of digits first by length of their name, and then alphabetically
276 Uses a compound orderby to sort a list of products, first by category, and then by unit price, from highest to lowest
277 Uses a subquery to sort String
278 Uses All to determine whether an array contains only odd numbers
279 Uses an OrderBy and a ThenBy clause with a custom comparer to sort first by word length and then by a case-insensitive descending sor
280 Uses Average to get the average length of the words in the string array
281 Uses Average to get the average of all values of an integer array
282 Uses Concat to merge the names of all customers and products
283 Uses group by to partition a list of each customers orders, first by year, and then by month
284 Uses group by to partition a list of products by category
285 Uses GroupBy to partition trimmed elements of an array using a custom comparer
286 Uses Max to get the highest number in an integer array
287 Uses Max to get the length of the longest word in a string array
288 Uses Min to get the length of the shortest word in a string array
289 Uses Repeat to generate a sequence that contains the number 7 ten times
290 Uses select to create a sequence of each product name
291 Uses Skip to get all but the first 4 elements of the array
292 Using DefaultIfEmpty in Where clause
293 Using var
294 Where by Prototype
295 Where clause
296 Where clause with string method and return IEnumerable object
297 Where Prototype
298 Where with OrderBy
299 Without Using DefaultIfEmpty