linq "let" translation
- by luke
I understand that when the C# compiler sees a linq query comprehension, it basically does a straight translation to the corresponding Linq Extension methods and lambdas. i.e.
from x in list
select x.property
gets translated to:
list.Select(x => x.property)
my question is what do let clauses get translated to. for example how would this get translated by the compiler.
from x in list
let v = SomeComplexExpressionDependingOnx
select v
(p.s. i know this could be reduced to just select SomeComplexExpressionDependingOnx but i want to know how this is done in general)
Thanks!