Biwen.EFCore.UseRowNumberForPaging
2.4.0
dotnet add package Biwen.EFCore.UseRowNumberForPaging --version 2.4.0
NuGet\Install-Package Biwen.EFCore.UseRowNumberForPaging -Version 2.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Biwen.EFCore.UseRowNumberForPaging" Version="2.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Biwen.EFCore.UseRowNumberForPaging" Version="2.4.0" />
<PackageReference Include="Biwen.EFCore.UseRowNumberForPaging" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Biwen.EFCore.UseRowNumberForPaging --version 2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Biwen.EFCore.UseRowNumberForPaging, 2.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Biwen.EFCore.UseRowNumberForPaging@2.4.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Biwen.EFCore.UseRowNumberForPaging&version=2.4.0
#tool nuget:?package=Biwen.EFCore.UseRowNumberForPaging&version=2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Biwen.EFCore.UseRowNumberForPaging
Bring back support for UseRowNumberForPaging in EntityFrameworkCore 10.0/9.0/8.0/7.0/6.0
- for EFCore 8.0/9.0/10.0 using
2.0.0+ - for EFCore 6.0/7.0/8.0 using
1.0.0
Usage
The same as original UseRowNumberForPaging method
// using
using Biwen.EFCore.UseRowNumberForPaging;
// UseRowNumberForPaging()
optionsBuilder.UseSqlServer("connection string", o => o.UseRowNumberForPaging());
Sample
//select & group by
var iquery = from e in dbContext.Users
where e.CreatedDate < DateTime.Now
group e by e.Email into gg
select new
{
Email = gg.Key,
Count = gg.Count()
};
//having
iquery = iquery.Where(x => x.Count > 1);
var list = iquery.OrderByDescending(x => x.Count).Skip(10).Take(20).ToList();
Generated SQL
DECLARE @__p_0 int = 10;
DECLARE @__p_1 int = 20;
SELECT [t].[Email], [t].[Count]
FROM (
SELECT [u].[Email], COUNT(*) AS [Count], ROW_NUMBER() OVER(ORDER BY COUNT(*) DESC) AS [_Row_]
FROM [Users] AS [u]
WHERE [u].[CreatedDate] < GETDATE()
GROUP BY [u].[Email]
HAVING COUNT(*) > 1
) AS [t]
WHERE [t].[_Row_] > @__p_0 AND [t].[_Row_] <= @__p_0 + @__p_1
Note
自2.2.0后不再兼容NET5/6/7,如需早期兼容请使用1.0.0!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.0 && < 11.0.0)
-
net8.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.22 && < 9.0.0)
-
net9.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.11 && < 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.