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
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
Code:
public List<Customer> CustomerList(string searchCriteria, string orderby, int start, int pageSize)
{
var q = from c in context.Customer
Where c.CustomerName.Contains("John")
Orderby c.CustomerName
Skip(start).Take(pageSize)
select();
return q.ToList();
}