Monday, August 31, 2009

linq equivalencias para los nuevos...

============== LINQ EQUIVALENT ==============

from m in MyTable
take 10
select m.Foo


EQUALS

Select top 10 Foo from MyTable


var x = (from y in context.MyTable
where y.MyField = value
select (int?)y.MyCounter).Max();

EQUALS

SELECT MAX_(myCounter) from mytable y
where y.myfield = value


EQUIVALENT TO MAX IN SQL

-===============================================

No comments: