Closed behzad888 closed 3 years ago
? You're mentioning some code in SqliteDbContextObjectsProvider which is related to Sqlite, not Sql server, I can't get it!
Whoops! my bad!
It has nothing to do with Offset/Next/Fetch etc. Could you please provide me more details? This code only provides a connection to ef core context options.
We implement paging option for web API on top of repositories. When we use Take and Skip methods of Dynamic.Linq dependency we got Offset/Next/Fetch etc. problem to Invoke UseSqlServer
.
btw, If I use dbContextOptionsBuilder.UseSqlServer(dbConnection, c => c.UseRowNumberForPaging())
instead Invoke method it works correctly
You can inherit from DbContextObjectsProvider directly and use your own logic there. Then register that class and AppStartup. Sql server version 2012 and later have support for this, and this is a recommended approach too, so I think we may not change this code. Do you agree?
Sure, I agree. I think we need to prepare documentation and samples for these situations. I'll create a sample and merge as soon as possible then I'll close this issue with your opinion.
Thanks so much @behzad888 👍
hello help please in error "SqlException: Sintaxis incorrecta cerca de 'OFFSET'."
hello help please in error "SqlException: Sintaxis incorrecta cerca de 'OFFSET'."
https://github.com/bitfoundation/bitframework/issues/116#issuecomment-413488749
UseRowNumberForPaging has been removed EF Core 3.x
I'm getting the error Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement. because SQL Server 2008 doesn't recognize it.
So, based on aspnet/EntityFrameworkCore#4616 I think this method should be changed!?