Има настройка за съвместимост (UseRowNumberForPaging
) за това, което може да бъде конфигурирано или в самия DbContext:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var coonectionString = "Data Source=localhost\\MSSQLSERVER01;Initial Catalog=AppDb01;Integrated Security=True";
optionsBuilder.UseSqlServer(coonectionString, builder => builder.UseRowNumberForPaging());
}
Или като част от 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()));
}