Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of all LINQ query expression keywords? [closed]

Tags:

c#

.net

linq

So I've been doing things with LINQ lately and I've been looking online for a complete list of all integrated LINQ keywords and i couldn't find any.

These are some of the ones i know:

from in 
let 
group by into
orderby
where
select

Are there any others that I don't know about? Where can I go to find a complete list of all the things possible with integrated LINQ?

like image 946
caesay Avatar asked Apr 22 '12 19:04

caesay


People also ask

What are LINQ query expressions?

Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language. Traditionally, queries against data are expressed as simple strings without type checking at compile time or IntelliSense support.

What is LINQKit?

What is LINQKit? LINQKit is a free set of extensions for LINQ to SQL and Entity Framework power users. It comprises the following: An extensible implementation of AsExpandable() A public expression visitor base class (ExpressionVisitor)

Is LINQ faster than foreach?

LINQ syntax is typically less efficient than a foreach loop. It's good to be aware of any performance tradeoff that might occur when you use LINQ to improve the readability of your code.

What do most LINQ operators return?

These operators return a Boolean value i.e. True or False when some or all elements within a sequence satisfy a specific condition.


2 Answers

You need to distinguish in your mind between the standard LINQ query operators and the operators that are supported in C# by query expressions. There are far more of the former than the latter - and VB supports some of them in the language directly.

For quite a bit of detail about all the different operators, and which query expression parts bind to them, you may want to read my Edulinq blog post series. It's a reimplementation of LINQ to Objects for educational purposes, looking at how each operator behaves etc. Part 41 is explicitly about query expressions, including a cheat sheet at the bottom.

like image 68
Jon Skeet Avatar answered Nov 10 '22 06:11

Jon Skeet


You can read the official MSDN documentation here. Another good reference can be found on odetocode.

Edit:

I just wanted to clarify that what you're looking for are the C# keywords for LINQ, not operators.

like image 36
lordcheeto Avatar answered Nov 10 '22 05:11

lordcheeto