MinimalApi.Extensions.EFCore
1.0.1
dotnet add package MinimalApi.Extensions.EFCore --version 1.0.1
NuGet\Install-Package MinimalApi.Extensions.EFCore -Version 1.0.1
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="MinimalApi.Extensions.EFCore" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinimalApi.Extensions.EFCore" Version="1.0.1" />
<PackageReference Include="MinimalApi.Extensions.EFCore" />
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 MinimalApi.Extensions.EFCore --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MinimalApi.Extensions.EFCore, 1.0.1"
#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 MinimalApi.Extensions.EFCore@1.0.1
#: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=MinimalApi.Extensions.EFCore&version=1.0.1
#tool nuget:?package=MinimalApi.Extensions.EFCore&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MinimalApi.Extensions.EFCore
EFCore 经常使用的扩展
dotnet add package MinimalApi.Extensions.EFCore
池化DbContext
// 创建 DbContext 类
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
public string TenantId {get; set;}
}
// 继承重写 DbContextScopedFactory
public class AppDbContextScopedFactory(IDbContextFactory<TDbContext> pooledFactory, ITenantService tenantService) : DbContextScopedFactory<AppDbContext>(pooledFactory)
{
protected override void OnCreateDbContext(AppDbContext dbContext)
{
dbContext.TenantId = tenantService.Id;
}
}
// 注册
services.AddPooledDbContext<AppDbContext, AppDbContextScopedFactory>(builder=>
{
builder.UseNpgsql("xxxx");
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- EFCore.NamingConventions (>= 10.0.1)
- Microsoft.EntityFrameworkCore.Abstractions (>= 10.0.7)
-
net9.0
- EFCore.NamingConventions (>= 9.0.0)
- Microsoft.EntityFrameworkCore.Abstractions (>= 9.0.15)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on MinimalApi.Extensions.EFCore:
| Package | Downloads |
|---|---|
|
MinimalApi.Extensions
Package Description |
|
|
MinimalApi.Extensions.EFCore.Npgsql
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 121 | 5/7/2026 |
| 1.0.0 | 134 | 5/6/2026 |
| 1.0.0-beta | 401 | 4/20/2025 |