In the book “Essential LINQ” by Calvert and Kulkarni, the terms “LINQ operator” and “LINQ keyword” are both used. What is the difference between these two terms?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Operators are a set of extension methods on the IEnumerable interface providing query capabilities including : filtering, projection, aggregation, sorting. They can be applied to any enumerations and collections.
Keywords are a set of keywords added to the language(a language extensions) itself (C# or VB) that are used to construct a LINQ expression, under the hood keywords calls the corresponding operator. Not all operators have their corresponding keyword, only some of the more frequently used standard query operators have dedicated C# and Visual Basic language keyword syntax that enables them to be called as part of a query expression.
So, the difference between the two is the different form(visual impact) that they give to the code, under the hood same methods are called(operator extension methods).
Example from msdn :