Entity Framework - 3 tier - PagedData GetList Method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muratto
    New Member
    • Jul 2009
    • 2

    #1

    Entity Framework - 3 tier - PagedData GetList Method

    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


    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();
    }
    Last edited by Frinavale; Jul 3 '09, 02:30 PM. Reason: Added code tags. Please post code in [code] [/code] tags.
Working...