C# LINQ Query Keywords
The LINQ queries are server side contextually language integrated queries that enable you to work with data items retrieved from any kind of data source. Likewise other database query language LINQ also contains few contextual keywords that instruct the compiler which action to perform. LINQ uses most common type of clauses that each type of SQL based query languages use such as where, select, from and the aggregate functions such as sum, min, max etc. Here is a list of LINQ Query Keywords that provide the similar function which can be implemented in C# code for ASP.Net web pages:
1. from: It specifies the data source and a range variable that belongs to each element of data source sequence.
2. where: It filters the results based on the Boolean expressions specified using logical AND and OR operations such as && and ||.
3. select: It specifies the type and shape of the returned result that will be retrieved after executing the query expression.
4. group: It groups the results sequence based on the specified key value
5. into: It provides the identifier for the results sequence retrieved from the group, select or join clause.
6. orderby: It sorts the results sequence in ascending or descending order according to the default comparer for the element type.
7. join: It joins the data sources based on the relational comparison between specified matching criteria.
8. let: It enables you to declare a range variable to store the sub-expression results inside the query expression.
9. in: It is used in join and from clause that points to each element of the data source sequence by applying iterations over them.
10. on: It is used in join clause to specify the comparison test between two data source elements.
11. equals: It is used in join clause to compare the two data source elements.
12. by: It is used in group clause of query expression to specify the grouping criteria.
13. ascending: It is used with orderby clause that instructs the compiler to sort the results sequence from smallest to largest.
14. descending: It is used with orderby clause that instructs the compiler to sort the results sequence from largest to smallest.
Continue to next tutorial: LINQ from Clause Using C# in ASP.Net to learn how to use the from LINQ query keyword.