Franz.Common.EntityFramework
2.3.1
dotnet add package Franz.Common.EntityFramework --version 2.3.1
NuGet\Install-Package Franz.Common.EntityFramework -Version 2.3.1
<PackageReference Include="Franz.Common.EntityFramework" Version="2.3.1" />
<PackageVersion Include="Franz.Common.EntityFramework" Version="2.3.1" />
<PackageReference Include="Franz.Common.EntityFramework" />
paket add Franz.Common.EntityFramework --version 2.3.1
#r "nuget: Franz.Common.EntityFramework, 2.3.1"
#:package Franz.Common.EntityFramework@2.3.1
#addin nuget:?package=Franz.Common.EntityFramework&version=2.3.1
#tool nuget:?package=Franz.Common.EntityFramework&version=2.3.1
Franz.Common.EntityFramework
Persistence and infrastructure integration for the Franz.Common framework on .NET 10.
Overview
The Franz.Common.EntityFramework package provides persistence and infrastructure integration within Franz.Common. It is designed to compose with the rest of the framework rather than imposing unrelated infrastructure choices on every application.
Installation
dotnet add package Franz.Common.EntityFramework
Design principles
- Explicit composition: register only the capabilities the application needs.
- Clear boundaries: keep domain and application contracts independent from provider-specific infrastructure where the package's role permits it.
- Predictable behavior: make configuration, failure modes, and lifecycle ownership visible rather than relying on hidden conventions.
- Operational readiness: validate security, resilience, diagnostics, and compatibility for the actual deployment environment.
Usage and configuration
Follow the package-specific setup, configuration, and code examples below. Only configure external services when this package requires them, and keep secrets outside source control.
Package-specific guide
π Version
Current Version: v2.3.0
π§ Architectural Evolution (IMPORTANT CHANGE)
β Before (v2.1.4)
βPragmatic EF Core persistence libraryβ
β Now (v2.2.1)
Framework-managed transactional persistence engine with opt-in orchestration
π§ Core Philosophy (NEW)
Persistence is no longer a repository responsibility β it is a framework-controlled consistency boundary.
Key shift:
- Repositories = mutation intent
- UnitOfWork = commit boundary
- Pipeline = implicit transaction scope
- DbContext = execution engine
βοΈ Transaction Model (NEW CORE CONCEPT)
Franz now supports 3 execution modes:
π’ 1. Auto-Commit Mode (Simple Operations)
Repositories may persist immediately for isolated operations:
- CRUD endpoints
- single aggregate updates
- simple queries
β οΈ Not intended for multi-aggregate consistency
π΅ 2. Orchestrated Mode (UnitOfWork)
Explicit transactional boundary:
await repo.AddAsync(entity);
await repo.AddRangeAsync(entities);
await unitOfWork.SaveChangesAsync();
Used for:
- Skill creation
- Hero creation
- snapshot generation pipelines
- multi-aggregate consistency flows
π£ 3. Pipeline Mode (Implicit Transaction)
Command β PipelineBehavior β Transaction Scope β Commit
Used for:
- CQRS commands
- application layer operations
- validated workflows
π§± Core Architecture Concepts (UPDATED)
1. DbContextBase (Execution Engine)
DbContextBase is now explicitly:
The transactional execution engine of the framework
Responsibilities:
- Change tracking
- audit lifecycle
- soft delete enforcement
- domain event dispatching
- transaction coordination
- unit-of-work execution target
Key behavior change:
BEFORE:
βDbContext applies behaviorβ
NOW:
βDbContext executes framework-defined transactional rulesβ
2. Repository System (REFINED MODEL)
π¦ EntityRepository (Intent-Based Persistence)
public class EntityRepository<TDbContext, TEntity>
β Responsibilities:
- Express persistence intent
- Track entity state
- Support batch operations
- NO transaction ownership
β Removed responsibility:
- SaveChanges ownership
- transactional guarantees
π₯ NEW ADDITIONS (v2.2.1)
Batch operations added:
AddRangeAsyncUpdateRangeAsyncDeleteRangeAsyncSoftDeleteRangeAsync
π§ New rule:
Repositories describe what changes, not when changes are committed
3. Unit of Work (NEW CORE COMPONENT)
π¦ IUnitOfWork
public interface IUnitOfWork
{
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
}
β Role:
- Defines explicit transaction boundary
- Ensures atomic multi-repository operations
- Guarantees deterministic state commits
π§ Key principle:
If multiple aggregates are involved, UnitOfWork is mandatory.
4. Soft Delete System (UNCHANGED BUT REINFORCED)
Still applies globally:
DELETE β IsDeleted = true
β Now enforced at framework level only
- repositories no longer handle delete semantics
- DbContext enforces policy
5. Domain Events System (ENHANCED CLARITY)
Lifecycle:
- entities modified
- DbContext tracks changes
- commit executed
- events dispatched AFTER transaction completion
π§ NEW RULE:
Events are emitted only after UnitOfWork commit success OR pipeline completion.
6. Entity Model (UNCHANGED BUT REINFORCED)
Still:
public abstract class Entity<TId>
β Guarantees:
- identity ownership stays in domain
- audit is framework-managed
- soft delete is universal
7. Dependency Injection System (UPDATED SEMANTICS)
Auto-discovery now explicitly scoped:
- repositories β persistence layer
- behaviors β pipeline layer
- unit of work β opt-in transactional layer
NEW ADDITION:
services.AddUnitOfWork<TDbContext>();
Meaning:
βEnable explicit transactional orchestration modeβ
8. EF Entity Discovery (UNCHANGED)
Still:
- DbSet scanning
- IEntity filtering
- aggregate exclusion
β οΈ DESIGN RULES (UPDATED)
β FORBIDDEN
- repositories calling SaveChanges
- implicit multi-aggregate persistence
- mixing transaction boundaries inside domain logic
β REQUIRED
- UnitOfWork for multi-entity consistency
- batch operations for performance
- pipeline for CQRS safety
- DbContext as only persistence executor
π§ Updated Architecture Overview
DOMAIN LAYER
βββ Entity<TId>
βββ Aggregates
βββ Domain Events
APPLICATION LAYER
βββ CQRS
βββ SnapshotResolver
βββ Orchestration Services
FRAMEWORK LAYER (Franz 2.2.1)
βββ EntityRepository (intent-only)
βββ AddRange / UpdateRange / DeleteRange
βββ UnitOfWork (transaction boundary)
βββ PersistenceBehavior (pipeline transaction scope)
INFRASTRUCTURE LAYER
βββ DbContextBase (execution engine)
βββ ChangeTracker
βββ Soft Delete filter
βββ Event dispatcher
EF CORE LAYER
βββ DbSet<TEntity>
βββ SQL translation
βββ transaction execution
π§ͺ VERSION HISTORY (UPGRADED)
v2.2.1 β Transactional Framework Evolution
π§ Major Changes
- Removed βrepository owns persistenceβ model
- Introduced UnitOfWork as explicit transaction boundary
- Added batch operations (AddRange / UpdateRange / SoftDeleteRange)
- Redefined DbContext as execution engine
- Formalized pipeline-based transactional safety model
βοΈ Improvements
- deterministic multi-aggregate consistency
- improved snapshot safety
- reduced hidden side effects
- clearer orchestration boundaries
- scalable for simulation-heavy systems
β οΈ Breaking Change Conceptually
- SaveChanges is no longer repository-owned
- transaction ownership is now explicit or pipeline-driven
π FINAL SUMMARY
Franz.Common.EntityFramework v2.2.1 is now:
β not just EF abstraction β not just repository simplification β not CRUD wrapper anymore β a transactional orchestration framework
π§ Closing Statement (matches your philosophy)
This framework no longer abstracts Entity Framework β it formalizes deterministic persistence boundaries over it, ensuring consistency across complex domain simulations and multi-aggregate workflows.
Dependency maintenance β October 2026
This project's dependency references were reviewed and updated as part of the repository-wide .NET 10 maintenance pass. The intended target framework and public API remain unchanged. Verify the resolved direct and transitive dependency graph through the repository's dependency validation workflow before publishing. See the central dependency upgrade record.
| 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. |
-
net10.0
- Franz.Common.Business (>= 2.3.1)
- Franz.Common.DependencyInjection (>= 2.3.1)
- Franz.Common.Errors (>= 2.3.1)
- Franz.Common.MultiTenancy (>= 2.3.1)
- Franz.Common.Reflection (>= 2.3.1)
- Microsoft.EntityFrameworkCore (>= 10.0.14)
- Microsoft.EntityFrameworkCore.Cosmos (>= 10.0.14)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.14)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.14)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Franz.Common.EntityFramework:
| Package | Downloads |
|---|---|
|
Franz.Common.EntityFramework.SQLServer
Shared utility library for the Franz Framework. |
|
|
Franz.Common.EntityFramework.MariaDB
Shared utility library for the Franz Framework. |
|
|
Franz.Common.EntityFramework.PostGres
Shared utility library for the Franz Framework. |
|
|
Franz.Common.MongoDB
Shared utility library for the Franz Framework. |
|
|
Franz.Common.SSO
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.1 | 109 | 10/26/2026 |
| 2.3.0 | 347 | 7/21/2026 |
| 2.2.19 | 226 | 7/19/2026 |
| 2.2.18 | 229 | 7/19/2026 |
| 2.2.17 | 335 | 7/12/2026 |
| 2.2.16 | 245 | 7/2/2026 |
| 2.2.15 | 254 | 6/29/2026 |
| 2.2.14 | 235 | 6/29/2026 |
| 2.2.13 | 242 | 6/29/2026 |
| 2.2.12 | 236 | 6/28/2026 |
| 2.2.11 | 227 | 6/28/2026 |
| 2.2.10 | 246 | 6/28/2026 |
| 2.2.9 | 235 | 6/28/2026 |
| 2.2.8 | 235 | 6/28/2026 |
| 2.2.7 | 240 | 6/7/2026 |
| 2.2.6 | 244 | 6/6/2026 |
| 2.2.5 | 249 | 6/4/2026 |
| 2.2.4 | 233 | 6/3/2026 |
| 2.2.3 | 231 | 6/2/2026 |
| 2.2.2 | 224 | 6/2/2026 |