Paging in Entity Framework

前端 未结 6 1290
情书的邮戳
情书的邮戳 2020-12-03 00:56

In Entity Framework, using LINQ to Entities, database paging is usually done in following manner:

int totalRecords = EntityContext.Context.UserSet.Count;
var         


        
6条回答
  •  难免孤独
    2020-12-03 01:39

    Whats wrong with two calls? They are small and quick queries. Databases are designed to support lots of small queries.

    A developing a complex solution to do one query for paging isn't going give you much pay off.

提交回复
热议问题