Franz.Common.Business
3.0.0
dotnet add package Franz.Common.Business --version 3.0.0
NuGet\Install-Package Franz.Common.Business -Version 3.0.0
<PackageReference Include="Franz.Common.Business" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Business" Version="3.0.0" />
<PackageReference Include="Franz.Common.Business" />
paket add Franz.Common.Business --version 3.0.0
#r "nuget: Franz.Common.Business, 3.0.0"
#:package Franz.Common.Business@3.0.0
#addin nuget:?package=Franz.Common.Business&version=3.0.0
#tool nuget:?package=Franz.Common.Business&version=3.0.0
Franz.Common.Business
Domain-model primitives for entities, aggregate roots, factories, domain events, audit lifecycle, and identity generation.
Overview
The Business package provides the framework's domain-layer building blocks. It does not own database persistence or transport delivery; those concerns are implemented by infrastructure packages.
Installation
dotnet add package Franz.Common.Business
Entity model
Entity<TKey> implements IEntity<TKey> and provides:
- Constructor-established identity with a private setter.
- Equality based on entity type and non-transient identity.
- Audit lifecycle fields and
MarkCreated,MarkUpdated, andMarkDeleted. - Soft-delete state through
IsDeleted. - A protected constructor accepting the entity identifier.
Use the factory abstraction when the domain entity requires an ID constructor:
public sealed class Customer : Entity<Guid>
{
protected Customer(Guid id) : base(id) { }
}
public sealed class CustomerService(IEntityFactory<Guid, Customer> factory)
{
public Customer Create() => factory.Create();
}
EntityFactory<TKey, TEntity> requires a single-argument constructor accepting TKey. It compiles and caches the constructor delegate when runtime code generation is available; Native AOT uses preserved constructor metadata without compiling an expression. The generic entity type is annotated so its public and non-public constructors survive trimming. Misconfigured entity types fail when the factory type is initialized.
AggregateFactory<TAggregate, TEvent> follows the same construction contract for aggregate roots: a single Guid constructor, a compiled delegate on JIT runtimes, and preserved-constructor invocation under Native AOT. Enumeration lookup preserves the public static fields that define each enumeration.
Aggregate roots and domain events
AggregateRoot<TEvent> provides event application, replay/rehydration, version tracking, and access to uncommitted changes. Concrete aggregates register event-application handlers and raise events through the protected RaiseEvent method. Persistence and publication of those events remain application/infrastructure responsibilities.
Optimistic concurrency
Entities can derive from ConcurrencyTrackedEntity<TKey>, which inherits Entity<TKey> and implements IConcurrencyTrackedEntity, or implement the interface directly with a long ConcurrencyVersion property. DbContextBase initializes the version to 1 on insert and increments it on tracked updates; application code should not mutate it.
Business registration
AddBusiness(applicationAssembly) registers the GUID v7 ID generator, entity factories, Mediator infrastructure, and handlers for the explicitly supplied application assembly. Handler collection delegates to the Mediator source-generated registration registry; the application assembly must be compiled with the Franz Mediator source generator. This is the supported registration path for Native AOT and trimming. The Business AOT smoke suite exercises generated command dispatch, entity and aggregate construction, and enumeration lookup.
The optional AddBusinessPlatform() pipelines are separate integrations and are not covered by the Business package's AOT smoke contract; qualify their packages independently before making an application-wide claim.
using Franz.Common.Business.Extensions;
builder.Services.AddBusiness(typeof(Program).Assembly);
Optional platform pipelines are registered separately:
builder.Services.AddBusinessPlatform();
The platform helper adds Serilog logging, retry, circuit-breaker, timeout, and bulkhead Mediator pipelines. Register only the composition your application intends to use.
Architectural boundaries
- Domain entities and aggregates own domain state and invariants.
- Entity factories establish identity during construction.
- Persistence adapters own database mapping, audit application, soft-delete filters, and concurrency enforcement.
- Mediator and messaging packages own dispatch and transport behavior.
License
MIT. See the repository LICENSE.
| 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.DependencyInjection (>= 3.0.0)
- Franz.Common.Errors (>= 3.0.0)
- Franz.Common.Mediator (>= 3.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Scrutor (>= 7.0.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on Franz.Common.Business:
| Package | Downloads |
|---|---|
|
Franz.Common.Serialization
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging
Shared utility library for the Franz Framework. |
|
|
Franz.Common.EntityFramework
Shared utility library for the Franz Framework. |
|
|
Franz.Common.MongoDB
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Bootstrap
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 370 | 11/10/2026 |
| 2.3.4 | 741 | 11/1/2026 |
| 2.3.3 | 632 | 10/28/2026 |
| 2.3.2 | 435 | 10/27/2026 |
| 2.3.1 | 496 | 10/26/2026 |
| 2.3.0 | 671 | 7/21/2026 |
| 2.2.19 | 506 | 7/19/2026 |
| 2.2.18 | 496 | 7/19/2026 |
| 2.2.17 | 1,143 | 7/12/2026 |
| 2.2.16 | 496 | 7/2/2026 |
| 2.2.15 | 498 | 6/29/2026 |
| 2.2.14 | 505 | 6/29/2026 |
| 2.2.13 | 514 | 6/29/2026 |
| 2.2.12 | 495 | 6/28/2026 |
| 2.2.11 | 508 | 6/28/2026 |
| 2.2.10 | 497 | 6/28/2026 |
| 2.2.9 | 505 | 6/28/2026 |
| 2.2.8 | 499 | 6/28/2026 |
| 2.2.7 | 502 | 6/7/2026 |
| 2.2.6 | 503 | 6/6/2026 |