I would like to know if Deferred Execution can be used for queries in method syntax and query syntax , I’m interested to know if there are any difference. Thanks
I would like to know if Deferred Execution can be used for queries in
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.
Actually there is only method syntax. When you write your query with query syntax, compiler translates it to method syntax (actually to static methods calls).
Example:
Extension method call (method syntax)
Is compiled as (yes extension methods are just a syntax sugar for calls of static class methods)
Same result gives (this is a syntax sugar for same Queryable/Enumerable methods calls)
So, both syntaxes produce same code. Thus there is no difference which syntax you are using – deferred execution (and anything else) will work in the same way.