I have the following linq-to-entities query with 2 joined tables that I would like to add pagination to:
IQueryable data = from inventory
Define the join in your mapping, and then use it. You really don't get anything by using the Join
method - instead, use the Include
method. It's much nicer.
var data = objContext.ProductInventory.Include("Variant")
.Where(i => i.ProductId == productId && i.StoreId == storeId)
.OrderBy(j => j.Variant.SortOrder)
.Skip(x)
.Take(y);