UseRowNumberForPaging is not a valid

asp.net-core-mvc entity-framework-core sql-server-2008

Question

I'm using "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final" with SQL 2008 and according to some results found on Google, I just have to add the option to .UseRowNmberForPaging() when creating a new DBcontext. This was the solution for rc1-final but it doesn't seem to work for rc2-final.

When I add the option when configuring my service, it's not recognized.

Trying to paginate records on SQL Server 2008 with EF Core so this seems to be the recommended solution.

Here is the line I'm using to Configure the service:

services.AddDbContext<Data.Models.AC_MCLContext>(options =>
               options.UseSqlServer(connection).UseRowNumberForPaging()); 

Does anyone know how to use the row number for paging in EntityFramework Core rc2?

1
6
6/11/2016 5:57:41 PM

Popular Answer

A solution was given to me on another forum so I thought I'd share the answer in case anyone else ran into this issue.

The API now uses a nested closure pattern so the options should be configured as a nested structure like the example below.

        services.AddDbContext<Data.Models.AC_MCLContext>(options =>
               options.UseSqlServer(connection, 
               opt => opt.UseRowNumberForPaging()));
25
5/24/2016 8:29:52 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow