Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement "in Entity Framework core"

There is a compatibility setting (UseRowNumberForPaging) for this which can be configured either in the DbContext itself:

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        var coonectionString = "Data Source=localhost\\MSSQLSERVER01;Initial Catalog=AppDb01;Integrated Security=True";
        optionsBuilder.UseSqlServer(coonectionString, builder => builder.UseRowNumberForPaging());
    }

Or as a part of the 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()));
    }

UseRowNumberForPaging was removed in EF Core 3.x, method is marked as obsolete. However, you can use EfCore3.SqlServer2008Query package instead. There are 2 packages available in Nuget, one for >= .NET 5.0, other one is for >= .NET 3.1

enter image description here

Usage:

 services.AddDbContext<MyDbContext>(o => 
       o.UseSqlServer(Configuration.GetConnectionString("Default"))
        .ReplaceService<IQueryTranslationPostprocessorFactory, SqlServer2008QueryTranslationPostprocessorFactory>());