I can't find "by" in lists of reserved keywords in C# but the Resharper Visual Studio plug-in seems to consider it being one - it prepends it with a @ escape whenever it generates code (e.g. by executing a refactoring command)
by is a Query Keyword, i.e., it's a keyword only in certain positions within LINQ Query Expressions, in particular only within a group clause.
The by contextual keyword is used in the group clause in a query expression to specify how the returned items should be grouped.
by
is used within LINQ query syntax. It's reserved only within query syntax context.
by
is not a reserved word it is a query word
for using LINQ:
For example:
(from x in Collection
group x by n);
You can escape any C# reserved
word by using the @
symbol in front of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With