Franz.Common.EntityFramework
2.2.1
dotnet add package Franz.Common.EntityFramework --version 2.2.1
NuGet\Install-Package Franz.Common.EntityFramework -Version 2.2.1
<PackageReference Include="Franz.Common.EntityFramework" Version="2.2.1" />
<PackageVersion Include="Franz.Common.EntityFramework" Version="2.2.1" />
<PackageReference Include="Franz.Common.EntityFramework" />
paket add Franz.Common.EntityFramework --version 2.2.1
#r "nuget: Franz.Common.EntityFramework, 2.2.1"
#:package Franz.Common.EntityFramework@2.2.1
#addin nuget:?package=Franz.Common.EntityFramework&version=2.2.1
#tool nuget:?package=Franz.Common.EntityFramework&version=2.2.1
π¦ Franz.Common.EntityFramework v2.2.1
π Version
v2.2.1
π§ 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.
| 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.2.1)
- Franz.Common.DependencyInjection (>= 2.2.1)
- Franz.Common.Errors (>= 2.2.1)
- Franz.Common.MultiTenancy (>= 2.2.1)
- Franz.Common.Reflection (>= 2.2.1)
- Microsoft.EntityFrameworkCore (>= 10.0.8)
- Microsoft.EntityFrameworkCore.Cosmos (>= 10.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.8)
- MongoDB.Driver (>= 3.8.1)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Franz.Common.EntityFramework:
| Package | Downloads |
|---|---|
|
Franz.Common.EntityFramework.MariaDB
Shared utility library for the Franz Framework. |
|
|
Franz.Common.EntityFramework.SQLServer
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.2.1 | 168 | 5/24/2026 |
| 2.1.4 | 184 | 4/27/2026 |
| 2.1.3 | 165 | 4/26/2026 |
| 2.1.2 | 173 | 4/26/2026 |
| 2.1.1 | 182 | 4/22/2026 |
| 2.0.2 | 179 | 3/30/2026 |
| 2.0.1 | 173 | 3/29/2026 |
| 1.7.8 | 179 | 3/2/2026 |
| 1.7.7 | 193 | 1/31/2026 |
| 1.7.6 | 195 | 1/22/2026 |
| 1.7.5 | 197 | 1/10/2026 |
| 1.7.4 | 187 | 12/27/2025 |
| 1.7.3 | 274 | 12/22/2025 |
| 1.7.2 | 259 | 12/21/2025 |
| 1.7.1 | 212 | 12/20/2025 |
| 1.7.0 | 364 | 12/16/2025 |
| 1.6.21 | 278 | 11/27/2025 |
| 1.6.20 | 291 | 11/24/2025 |
| 1.6.19 | 283 | 10/25/2025 |
| 1.6.15 | 316 | 10/20/2025 |