Do this 2 queries equal or differ in performance?
var results = ctx.Products
.Where(x => x.Category.Name == "something")
.Select(x => new {
ProductId = x.Id,
ProductName = x.name,
CategoryName = x.Category.Name
})
.ToList();
var results = ctx.Products
.Select(x => new {
ProductId = x.Id,
ProductName = x.name,
CategoryName = x.Category.Name
})
.Where(x => x.CategoryName == "something")
.ToList();
Would SQL Server use the correct index in the second query?