OptimusFramework.DataAccess.EFCore 2.2.0

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

OptimusFramework.DataAccess.EFCore

Entity Framework Core implementation of the data access layer for the Optimus Framework. Provides multi-tenant DbContext, generic repositories, Fluent API entity configurations, and transaction management.

Features

  • Multi-Tenant DbContext: UnitOfWorkEF with dynamic SQL Server connection strings per tenant
  • Generic Repository: RepositoryEF with full CRUD, DbSet access, and change tracking
  • Entity Type Configurations: Base classes for Fluent API mappings (EntityTypeConfigurationBase, EntityTypeConfigurationIdEntity, EntityTypeConfigurationNameDesc)
  • Transaction Support: ProcessInTransaction / ProcessInTransactionAsync for atomic operations
  • Built-in Repositories: RepoImage (image management with file system) and RepoMetafield
  • Validation Helpers: ValidateExistById, GetEntityByIds, FirstOrDefaultEntityById

Key Classes and Interfaces

Type Description
IUnitOfWorkEF EF Core UoW with Database, Set<T>, TenantConnection, transaction processing
UnitOfWorkEF DbContext-based implementation with dynamic connection configuration
IRepositoryEF<TEntity, TKey> EF Core repository interface with Set() access
RepositoryEF<TUnitOfWork> Base repository implementation
EntityTypeConfigurationBase<T> Base Fluent API configuration
EntityTypeConfigurationIdEntity<T> Auto-configuration for IIdEntity types
EntityTypeConfigurationNameDesc<T> Auto-configuration for INameDescEntity types
RepoImage Image repository with Base64, thumbnails, and file I/O
RepoMetafield Metafield repository

Installation

dotnet add package OptimusFramework.DataAccess.EFCore

Usage

using OptimusFramework.DataAccess.EFCore;

// Define your Unit of Work
public class MyDbContext : UnitOfWorkEF, IMyUnitOfWork
{
    public DbSet<Product> Products { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ApplyConfiguration(new ProductMap());
    }
}

// Transaction support
var result = await _uow.ProcessInTransactionAsync(async () =>
{
    _repo.Add(entity);
    await _uow.SaveChangesAsync();
    return entity;
});
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 (3)

Showing the top 3 NuGet packages that depend on OptimusFramework.DataAccess.EFCore:

Package Downloads
OptimusLog.DataAccess.EFCore

Package Description

OptimusFramework.AppService.EFCore

Package Description

OptimusSecurity.DataAccess.EFCore

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 108 4/3/2026
2.1.0 106 4/3/2026
2.0.1 139 2/18/2026
2.0.0 141 2/18/2026
1.1.0 101 4/3/2026