VOOZH about

URL: https://www.nuget.org/packages/CleanCodeJN.Repository.EntityFramework/

⇱ NuGet Gallery | CleanCodeJN.Repository.EntityFramework 2.0.1




👁 Image
CleanCodeJN.Repository.EntityFramework 2.0.1

dotnet add package CleanCodeJN.Repository.EntityFramework --version 2.0.1
 
 
NuGet\Install-Package CleanCodeJN.Repository.EntityFramework -Version 2.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="CleanCodeJN.Repository.EntityFramework" Version="2.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CleanCodeJN.Repository.EntityFramework" Version="2.0.1" />
 
Directory.Packages.props
<PackageReference Include="CleanCodeJN.Repository.EntityFramework" />
 
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 CleanCodeJN.Repository.EntityFramework --version 2.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CleanCodeJN.Repository.EntityFramework, 2.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 CleanCodeJN.Repository.EntityFramework@2.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=CleanCodeJN.Repository.EntityFramework&version=2.0.1
 
Install as a Cake Addin
#tool nuget:?package=CleanCodeJN.Repository.EntityFramework&version=2.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Generic Repository Implementation

Repository Abstraction for Entity Framework

This generic Repository implementation for Entity Framework abstracts completely all EF-References from your business layer in a domain driven design manner.

Features

  • Ready to use in seconds
  • Abstracts all EF specific Code out of your business layer
  • Easy to mock and test
  • On .NET 9.0

How to use

  • Add IEntity<T> interfaces to your domain classes
  • Add IDataContext Interface to your DBContext class
  • Use Extension RegisterRepositories() in your startup class or program.cs
  • Inject IRepository<T> in your business layer
  • Just use It

Step by step explanation

Add IEntity<T> interfaces to your domain classes:

public class Customer : IEntity<int>
{
 public int Id { get; set; }
}

Add IDataContext Interface to your DBContext class:

public partial class MyDbContext : DbContext, IDataContext
{ 
}

Use Extension RegisterDbContextAndRepositories() in your startup class or program.cs:

// Just register generic repositories and your dbContext which has the IDataContext marker interface
builder.Services.RegisterDbContextAndRepositories<MyDbContext>();

Inject IRepository<TEntity, TKey> (or IIntRepository, IStringRepository, IGuidRepository, ILongRepository) in your business layer:

public class MyService(IRepository<Customer, int> repository)
{ 
}

Just use it:

List<customer> customerWhoHavePayed = repository
 .Query(asNoTracking: true, asSplitQuery: true, includes: x => x.Invoices)
 .Where(x => x.Invoice.IsPayed)
 .ToList()

Sample Code

GitHub Full Sample

Product Versions Compatible and additional computed target framework versions.
.NET net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (2)

Showing the top 2 NuGet packages that depend on CleanCodeJN.Repository.EntityFramework:

Package Downloads
CleanCodeJN.GenericApis

Build production-ready .NET Web APIs in minutes, not days. CleanCodeJN.GenericApis is the ultimate full-stack API framework combining REST (Minimal APIs + MVC Controllers), GraphQL (HotChocolate), and MCP (Model Context Protocol) — all from a single generic setup. Powered by MediatR CQRS, Mapster, FluentValidation, and Entity Framework, it eliminates boilerplate for GET, GET by ID, POST, PUT, PATCH, and DELETE operations across every layer. Built-in pipeline behaviors deliver transparent caching and structured logging out of the box. The integrated AI Proxy streams responses from Anthropic Claude directly through your API, while the MCP server automatically exposes all your CRUD endpoints as discoverable tools for AI assistants like Claude, Cursor, and Copilot. Designed around the Integration Operation Segregation Principle (IOSP) for clean, testable, and maintainable business logic — at any scale.

CleanCodeJN.GenericApis.ServiceBusConsumer

This CleanCodeJN package for Service Bus simplifies the development of asynchronous microservices by providing a framework that leverages the power of MediatR and IOSP to consume service bus events from topics and execute commands to process these events.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 1,160 3/9/2026
2.0.0 1,496 2/28/2025
1.1.7 305 12/7/2024
1.1.6 496 10/8/2024
1.1.5 185 9/25/2024
1.1.4 333 9/12/2024
1.1.3 596 5/7/2024
1.1.2 234 5/7/2024
1.1.1 351 5/2/2024
1.1.0 198 5/2/2024
1.0.2 206 5/1/2024
1.0.1 210 5/1/2024
1.0.0 230 5/1/2024

BugFix: Call Update() instead of State = Modified.