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" />
<PackageReference Include="OptimusFramework.DataAccess.EFCore" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=OptimusFramework.DataAccess.EFCore&version=2.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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:
UnitOfWorkEFwith dynamic SQL Server connection strings per tenant - Generic Repository:
RepositoryEFwith full CRUD, DbSet access, and change tracking - Entity Type Configurations: Base classes for Fluent API mappings (
EntityTypeConfigurationBase,EntityTypeConfigurationIdEntity,EntityTypeConfigurationNameDesc) - Transaction Support:
ProcessInTransaction/ProcessInTransactionAsyncfor atomic operations - Built-in Repositories:
RepoImage(image management with file system) andRepoMetafield - 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 | Versions 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.
-
net10.0
- AutoMapper (>= 13.0.1)
- Microsoft.EntityFrameworkCore (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Abstractions (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.3)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.3)
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Newtonsoft.Json (>= 13.0.3)
- OptimusFramework.DataAccess.Domain (>= 2.0.1)
- OptimusFramework.DataAccess.Generic (>= 2.0.1)
- OptimusFramework.Utils (>= 2.2.0)
- System.Drawing.Common (>= 10.0.0)
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.