Er is een compatibiliteitsinstelling (UseRowNumberForPaging
) hiervoor die kan worden geconfigureerd in de DbContext zelf:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var coonectionString = "Data Source=localhost\\MSSQLSERVER01;Initial Catalog=AppDb01;Integrated Security=True";
optionsBuilder.UseSqlServer(coonectionString, builder => builder.UseRowNumberForPaging());
}
Of als onderdeel van de Startup:
public void ConfigureServices(IServiceCollection services)
{
var coonectionString = "Data Source=localhost\\MSSQLSERVER01;Initial Catalog=AppDb01;Integrated Security=True";
services.AddDbContext<AppDbContext>(options => options.UseSqlServer(coonectionString, builder => builder.UseRowNumberForPaging()));
}