I am reading up on Linq and the author uses both query expressions and dot notation. He says that the query expression is translated to the dot notation. So is it true that dot notation is faster?
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.
“Query expression is translated to the dot notation” means that the compiler translates LINQ statements to invokations of the equivalent methods (which are in the Enumerable class, by the way). So, if you directly use the methods you are just saving some work to the compiler, but at runtime there is indeed no difference. Use whatever notation makes your code more readable.