NKF.Persistence.Base
1.0.1
Requires NuGet 5.0.0 or higher.
dotnet add package NKF.Persistence.Base --version 1.0.1
NuGet\Install-Package NKF.Persistence.Base -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="NKF.Persistence.Base" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NKF.Persistence.Base" Version="1.0.1" />
<PackageReference Include="NKF.Persistence.Base" />
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 NKF.Persistence.Base --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NKF.Persistence.Base, 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 NKF.Persistence.Base@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=NKF.Persistence.Base&version=1.0.1
#tool nuget:?package=NKF.Persistence.Base&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NKF.Persistence.Base
Persistence abstractions: Repository pattern, Unit of Work, and multi-tenancy.
Features
- IRepository<T> — Read repository
- ICommandRepository<T> — Write repository (Add, Update, Remove)
- IQueryRepository<T> — Read-only repository
- ITypedCommandRepository<TEntity,TId> — Strongly-typed write repository for
TypedAggregateRoot<T,TId>(1.0.1) - ITypedQueryRepository<TEntity,TId> — Strongly-typed read repository for
TypedAggregateRoot<T,TId>(1.0.1) - IUnitOfWork / ICommandUnitOfWork / IQueryUnitOfWork — Transaction boundaries with auto
TenantIdpropagation - RepositoryCollection — Auto-discovery for repositories
- TenantContext — Multi-tenancy support (auto-assigns
ITenantAware.TenantId)
Install
dotnet add package NKF.Persistence.Base
Usage
public interface IBrandCommandRepository : ICommandRepository<Brand>
{
Task<bool> HasExistBrandByName(BrandName name, CancellationToken ct);
}
// Strongly-typed (1.0.1)
public interface ITypedBrandCommandRepository : ITypedCommandRepository<TypedBrand, BrandId>
{
Task<bool> HasExistBrandByName(BrandName name, CancellationToken ct);
}
// Auto-discovery registration
CommandCollection.AddFromAssembly(
typeof(IBrandCommandRepository),
typeof(BrandCommandRepository)
);
// In handler
var repo = _unitOfWork.GetCommandRepository<Brand>();
await repo.AddAsync(brand, ct);
await _unitOfWork.SaveAsync(ct);
// Typed with TenantId auto-propagation (assigned by CommandUnitOfWork/QueryUnitOfWork)
var typedRepo = _unitOfWork.GetTypedCommandRepository<TypedBrand, BrandId>();
await typedRepo.AddAsync(typedBrand, ct); // TenantId set automatically
Repository
github.com/rasoolnikravesh/NKF
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- NKF.Domain (>= 1.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NKF.Persistence.Base:
| Package | Downloads |
|---|---|
|
NKF.Persistence.Postgres.Base
NKF Persistence PostgreSQL Base Framework - EF Core PostgreSQL implementation with Command/Query repositories, Unit of Work, Tenant services |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 106 | 8/29/2026 |
| 1.0.1-beta.1.1 | 80 | 8/17/2026 |
| 1.0.0 | 112 | 8/16/2026 |
See CHANGELOG.md