I am using LINQ TO SQL in a ASP.NET MVC application and my code looks something like this
ISingleResult<proc_get_dataResult> sproc_result = db.proc_get_data();
return sproc_result .AsEnumerable().Cast<proc_get_dataResult>().ToList();
My code above returns the entire result set as a list. However, the query in question can return a ton of data so I want to limit the number of objects that are being created. Therefore, I now pass a page number into this method and if for example I pass in page 2, I would only like to return entries 26-50 if the per page constant is set to 25.
Is there a way to do this?
thanks in advance