Paging with Entity Framework 7 and SQL Server 2008

后端 未结 6 449
我寻月下人不归
我寻月下人不归 2020-12-08 10:35

I\'m trying to use paging (that is .Skip(...).Take(...) in Entity Framework 7. It works OK with Microsoft SQL Server 2012 and 2014, but fails with the following

6条回答
  •  庸人自扰
    2020-12-08 11:16

    Here, just set UseRowNumberForPaging() in ConfigureServices

    services.AddDbContext(options => 
    options.UseSqlServer(Configuration.GetConnectionString("Connectionstring"),opt=> { opt.UseRowNumberForPaging(); }));
    

提交回复
热议问题