Created
September 22, 2010 14:37
-
-
Save jfromaniello/591783 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Ahora pensa en esta | |
var q = from c in categories | |
join p in products on c equals p.Category into ps | |
select new { Category = c, MaxQuantity = ps.Max(p => p.Quantity), ProductsCount = ps.Count() }; | |
sin join: | |
//Forma sin join | |
var q = from c in categories | |
select new { | |
Category = c, | |
MaxQuantity = products.Where(p => p.Category == c).Max(p => p.Quantity), | |
ProductsCount = products.Count(p => p.Category == c) | |
}; | |
//si vos decís que las dos deberían tener la misma performance... | |
//si vos decís que el QueryProvider debería funcionar igual.... Es probable que MS te pida que le expliques vos como hacer el parseo del expression tree. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment