Connecting Tech Pros Worldwide Help | Site Map

Entity Framework - 3 tier - PagedData GetList Method

  #1  
Old July 2nd, 2009, 03:14 PM
Newbie
 
Join Date: Jul 2009
Posts: 1
Hello,

I'm trying to build a 3 tier architecture with Ado.NET Entity Framework.

I want to select only paged records from Database.

But I can't find a solution to make dynamic with Linq to Entites or ObjectQuery.
How can I enable orderby and searchCriteria parameters.

This is the static code...

Thanks


Expand|Select|Wrap|Line Numbers
  1. public List<Customer> CustomerList(string searchCriteria, string orderby, int start, int pageSize)
  2. {
  3.     var q = from c in context.Customer
  4.                Where c.CustomerName.Contains("John")
  5.                Orderby c.CustomerName
  6.                Skip(start).Take(pageSize)
  7.                select();
  8.  
  9.     return q.ToList();
  10. }

Last edited by Frinavale; July 3rd, 2009 at 03:30 PM. Reason: Added code tags. Please post code in [code] [/code] tags.
Reply

Tags
3 tier, entity framework, linq to entities