RepositoryKit.Core
9.0.5
dotnet add package RepositoryKit.Core --version 9.0.5
NuGet\Install-Package RepositoryKit.Core -Version 9.0.5
<PackageReference Include="RepositoryKit.Core" Version="9.0.5" />
<PackageVersion Include="RepositoryKit.Core" Version="9.0.5" />
<PackageReference Include="RepositoryKit.Core" />
paket add RepositoryKit.Core --version 9.0.5
#r "nuget: RepositoryKit.Core, 9.0.5"
#addin nuget:?package=RepositoryKit.Core&version=9.0.5
#tool nuget:?package=RepositoryKit.Core&version=9.0.5
<div align="center"> <img src="logo-64x64.png" width="120" alt="RepositoryKit logo" />
RepositoryKit.Core
Abstractions and Contracts for RepositoryKit
</div>
๐ฆ Package
This package defines the interfaces, contracts, and domain exceptions that all RepositoryKit
providers depend on.
It contains no external dependencies.
โ Interfaces
Interface | Purpose |
---|---|
IReadOnlyRepository<T> |
Abstraction for read-only queries |
IRepository<T> |
Generic CRUD operations for an entity |
IUnitOfWork<TContext> |
Transaction boundary for one context (DbContext) |
IUnitOfWorkManager |
Multi-context Unit of Work provider |
๐จ Exception
Exception | Purpose |
---|---|
RepositoryException |
Standard error with context (type, op, entity) |
- Provides rich error information with type, entity, operation, and inner exception.
- Used by all RepositoryKit providers for consistent exception handling.
๐ Typical Usage
You don't use RepositoryKit.Core
directly, but instead reference it from your repository implementation or consume its abstractions:
public class EfRepository<TEntity, TContext> : IRepository<TEntity>
where TEntity : class
where TContext : DbContext
{
// Implementation using RepositoryKit.Core interfaces
}
// Exception usage in a provider implementation:
throw new RepositoryException(
"A database error occurred while adding an entity.",
RepositoryErrorType.Add,
typeof(Product),
nameof(AddAsync),
ex
);
๐งช Testing with Mocks
var mock = new Mock<IRepository<Product>>();
mock.Setup(repo => repo.GetAllAsync()).ReturnsAsync(productsList);
๐ค Dependencies
- Microsoft.EntityFrameworkCore (for
DbContext
-based contracts) - No other dependencies
- Designed to be stable, lightweight, and fully mockable
๐ License
MIT ยฉ Ataberk Kaya
๐ This package is automatically referenced by all RepositoryKit.*
implementations
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 was computed. 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. |
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.5)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on RepositoryKit.Core:
Package | Downloads |
---|---|
RepositoryKit
Umbrella package for RepositoryKit - a modular repository pattern infrastructure that supports EF Core, MongoDB and clean LINQ extensions. |
|
RepositoryKit.Extensions
LINQ helper extensions for RepositoryKit. Adds support for Paginate, OrderByField, Chunk, and ForEach operations on IQueryable and IEnumerable. |
|
RepositoryKit.EntityFramework
Entity Framework Core implementation of RepositoryKit. Implements IRepository, IRepositoryQuery and IRepositoryBulk using DbContext and DbSet. |
|
RepositoryKit.MongoDB
MongoDB implementation of RepositoryKit. Implements IRepository, IRepositoryQuery and IRepositoryBulk using MongoClient and IMongoCollection. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial stable version aligned with .NET 9. Provides unified repository contracts for any data source.