tags:

views:

76

answers:

3

I'm trying to find the correct names for these 2 "types" of coding expressions in LINQ so that I can refer to them correctly. I want to say that the first is called "Fluent Style"?

var selectVar = arrayVar.Select( (a,i) => new { Line = a });

var selectVar =
    from s in arrayVar 
    select new { Line = s };
+4  A: 
aku
+1  A: 

the first isn't even really linq, its a lambda expression, with a type invariant object created. (a) => new { blah = b}

The second is a linq query filling an on the fly class that has a property Line. There is no hashrocket operator in this one, so this one is just plain old linq.

DevelopingChris
A: 

The name of the second form is "query comprehesion syntax", which the compiler translates into the first form.

David B