IUnitOfWorkVH.Abstractions 10.0.4

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

IUnitOfWorkVH.Abstractions

Description

This library is a set of interfaces that are needed to simplify the formation of Repository and Unit of Work patterns in client applications.

The basic project IUnitOfWorkVH been splitted to 2 separate libraries:

  • IUnitOfWorkVH.Abstractions - contains only interfaces that are needed to implement the Repository and Unit of Work patterns in the application.
  • IUnitOfWorkVH - contains the implementation of the Repository and Unit of Work patterns based on the interfaces from the IUnitOfWorkVH.Abstractions library.

It was done to provide flexible usage in Clean Architecture, where you can use only the interfaces from the IUnitOfWorkVH.Abstractions library in many projects/layers of your solution, but implement the full IUnitOfWorkVH library only in the infrastructure layer of your application.

E.g:

  • Projects/layers of your solution that can use only the interfaces from the IUnitOfWorkVH.Abstractions library:
    • Application layer - ref to *.Abstractions if needed
    • Domain layer - ref to *.Abstractions if needed
    • Infrastucture layer - ref to full IUnitOfWorkVH
    • etc.

References

Lib uses:

  • ResultVH NuGet package for returning results from the functions.
  • Microsoft.EntityFrameworkCore.Relational 10.0 - cause of used IDbContextTransaction which needed for BeginTransaction() method.

Content for Repositories

public interface IRepBase<T> where T : class
{
    IQueryable<T> Get(Expression<Func<T, bool>>? filter = null, string? include = null, bool asNoTracking = false);
}

public interface IRep<T> : IRepBase<T> where T : class
{
    void Add(T entity);
    void Remove(T entity);
}

Content for UnitOfWork

public interface IUnitOfWorkBase : IDisposable
{
    IDbContextTransaction BeginTransaction();
    Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default);
    Task<IResultBool> SaveChangesAsync(CancellationToken cancellationToken = default);
    IResultBool SaveChanges();
}

Usage

  1. Create local repository interfaces and classes based on your entities
// Entity
public class YourEntity1
{
    public int Id { get; set; }
    public string Name { get; set; }
}

public interface IRepYourEntity1 : IRepBase<YourEntity1>;

// or

public interface IRepYourEntity1 : IRepBase<YourEntity1>
{
    // place here additional properties or methods if needed
}

  1. Create a new local interface that implements the IUnitOfWorkBase interface
public interface IUnitOfWork : IUnitOfWorkBase
{
    // dont forget to put your local interfaces here as properties
    IRepYourEntity1 YourEntityRep1 { get; }

    // place here additional properties or methods if needed
}

  1. Use prepared abstractions in your local UnitOfWork class (see details of description in the README of the IUnitOfWorkVH package)

Don't forget to register the local IUnitOfWork interface in the DI container of your application.

Product 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on IUnitOfWorkVH.Abstractions:

Package Downloads
IUnitOfWorkVH

EF Core implementation of Unit of Work and Repository pattern with base Repos (IRepBase/RepBase - get-only; IRep/Rep - get/add/remove) for EFCore 10.0.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.4 160 7/15/2026
10.0.3 127 7/5/2026