score:3

Accepted answer

no. basically query expressions exist in order to keep this stuff away from you. there's no particularly simple way of mimicking transparent identifiers.

i find that when you hit transparent identifiers, it's almost always cleaner to use query expression syntax. it's definitely worth knowing both, as very simple queries are cleaner using method syntax, but the more complicated the query, the more likely it is to be easier to read using query expressions.

that's assuming it can all be represented with method expressions, of course. don't forget you can break up queries into separate statements without changing the meaning, so if you do need to call methods which don't have query expression equivalents, i sometimes find it best to separate it out like this:

var foo = from x in y
          join a in b on x.z equals a.z
          select new { a, x };

var bar = foo.skip(5)
             .take(10)
             .tolist();

i find that cleaner than just using brackets to mush the two syntax forms together.


Related Query

More Query from same tag