views:

291

answers:

3
+4  Q: 

c# Linq Keywords?

I'm adding more keywords to notepad++'s C# Syntax highlighting and it would really help if i had a complete list of LINQ keywords for c#.

+8  A: 

From memory:

from select where join on equals group by orderby ascending descending into let

EDIT: As Eric says, you may want to include var as well (you certainly should if you want to highlight all C# 3 contextual keywords).

If you're doing symbols too, you may want to include a pattern for =>

Jon Skeet
Thanks Mehrdad: there was bound to be one I'd forgotten :)
Jon Skeet
Accepting this one cause i can copy-paste right into the xml file :)
RCIX
Nice Jon. Of course, "where" was not added originally as a LINQ contextual keyword, it was added as a contextual keyword for generic constraints, so now it is a contextual keyword twice over! It is debatable whether "var", which you omit, should be counted as a "LINQ keyword". It was added for LINQ scenarios but is not part of the query comprehension syntax.
Eric Lippert
Yes, my natural translation of the question was "what are the keywords for query expressions" - I hadn't even considered `var`...
Jon Skeet
+7  A: 

You can get started here.

Sani Huttunen
+1  A: 

You can find the Linq Query keywords here.

Pete OHanlon