RepositoryKit.Core 9.0.5

dotnet add package RepositoryKit.Core --version 9.0.5
                    
NuGet\Install-Package RepositoryKit.Core -Version 9.0.5
                    
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="RepositoryKit.Core" Version="9.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RepositoryKit.Core" Version="9.0.5" />
                    
Directory.Packages.props
<PackageReference Include="RepositoryKit.Core" />
                    
Project file
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 RepositoryKit.Core --version 9.0.5
                    
#r "nuget: RepositoryKit.Core, 9.0.5"
                    
#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.
#addin nuget:?package=RepositoryKit.Core&version=9.0.5
                    
Install RepositoryKit.Core as a Cake Addin
#tool nuget:?package=RepositoryKit.Core&version=9.0.5
                    
Install RepositoryKit.Core as a Cake Tool

<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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
9.0.5 41 6/9/2025
9.0.4 38 6/9/2025
9.0.3 143 6/3/2025
9.0.2 143 6/1/2025

Initial stable version aligned with .NET 9. Provides unified repository contracts for any data source.