Connecting Tech Pros Worldwide Forums | Help | Site Map

Entity Framework - 3 tier - PagedData GetList Method

Newbie
 
Join Date: Jul 2009
Posts: 1
#1: Jul 2 '09
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. }



Reply

Tags
3 tier, entity framework, linq to entities