I use this method to get each page of data from EF:
public IEnumerable<MyObj> GetByPage(int page, int perPage)
{
return context.MyObj.Skip((page - 1) * perPage).Take(perPage);
}
I want to know ;would this code fetch all rows of MyObj
and store in memory and then will Skip
and Take
or all of above code will translate to SQL command?
If all first will store in memory,How can I use LINQ to entity to not to use memory to Skip
and Take
?