Query Keywords (C# Reference)

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

This section contains the contextual keywords used in query expressions.

ClauseDescription
fromSpecifies a data source and a range variable (similar to an iteration variable).
whereFilters source elements based on one or more Boolean expressions separated by logical AND and OR operators ( && or || ).
selectSpecifies the type and shape that the elements in the returned sequence will have when the query is executed.
groupGroups query results according to a specified key value.
intoProvides an identifier that can serve as a reference to the results of a join, group or select clause.
orderbySorts query results in ascending or descending order based on the default comparer for the element type.
joinJoins two data sources based on an equality comparison between two specified matching criteria.
letIntroduces a range variable to store sub-expression results in a query expression.
inContextual keyword in a join clause.
onContextual keyword in a join clause.
equalsContextual keyword in a join clause.
byContextual keyword in a group clause.
ascendingContextual keyword in an orderby clause.
descendingContextual keyword in an orderby clause.

C# Keywords
LINQ (Language-Integrated Query)
LINQ Query Expressions
Getting Started with LINQ in C#

Show: