ZenithArch.Abstractions
1.0.0
dotnet add package ZenithArch.Abstractions --version 1.0.0
NuGet\Install-Package ZenithArch.Abstractions -Version 1.0.0
<PackageReference Include="ZenithArch.Abstractions" Version="1.0.0" />
<PackageVersion Include="ZenithArch.Abstractions" Version="1.0.0" />
<PackageReference Include="ZenithArch.Abstractions" />
paket add ZenithArch.Abstractions --version 1.0.0
#r "nuget: ZenithArch.Abstractions, 1.0.0"
#:package ZenithArch.Abstractions@1.0.0
#addin nuget:?package=ZenithArch.Abstractions&version=1.0.0
#tool nuget:?package=ZenithArch.Abstractions&version=1.0.0
Zenith Arch
Compile-time architecture automation for .NET with Roslyn incremental source generation.
Installation
dotnet add package ZenithArch.Abstractions
dotnet add package ZenithArch.Generator
For source generator usage, configure analyzer-style reference:
<ItemGroup>
<PackageReference Include="ZenithArch.Abstractions" Version="1.0.8" />
<PackageReference Include="ZenithArch.Generator" Version="1.0.8" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
Optional CLI installation:
dotnet tool install --global ZenithArch.Cli --version 1.0.8
Quickstart
using ZenithArch.Abstractions.Attributes;
using ZenithArch.Abstractions.Enums;
[assembly: Architecture(
Profile = ArchitectureProfile.CqrsQuickStart,
Pattern = ArchitecturePattern.Cqrs,
GenerateDependencyInjection = true,
DbContextType = typeof(AppDbContext)
)]
namespace Demo.Domain;
[Entity]
public partial class Trip
{
public Guid Id { get; set; }
[Required]
[MinLength(3)]
[MaxLength(120)]
public string Name { get; set; } = string.Empty;
}
Build once:
dotnet build
Then register generated DI extensions:
builder.Services.AddZenithArchDependencies();
Full API Reference
ZenithArch.Abstractions.Attributes
ArchitectureAttribute: Assembly-level generation contract (pattern, profile, feature flags).- Example:
[assembly: Architecture(Pattern = ArchitecturePattern.Cqrs, GenerateDependencyInjection = true)]
- Example:
EntityAttribute: Marks a class as a generation candidate entity.- Example:
[Entity] public partial class Trip { }
- Example:
AggregateRootAttribute: Marks an entity as an aggregate root for domain-event-enabled generation.- Example:
[Entity, AggregateRoot] public partial class Order : EntityBase { }
- Example:
MapToAttribute: Declares DTO/view model mapping targets.- Example:
[MapTo(typeof(TripDto))] public partial class Trip : EntityBase { }
- Example:
QueryFilterAttribute: Marks properties as generated filter criteria.- Example:
[QueryFilter] public string? Name { get; set; }
- Example:
RequiredAttribute: Marks a property as required for generated validators.- Example:
[Required] public string Name { get; set; } = string.Empty;
- Example:
MinLengthAttribute: Declares minimum length validation.- Example:
[MinLength(3)] public string Name { get; set; } = string.Empty;
- Example:
MaxLengthAttribute: Declares maximum length validation.- Example:
[MaxLength(120)] public string Name { get; set; } = string.Empty;
- Example:
EmailAttribute: Marks a property for email-format validation.- Example:
[Email] public string ContactEmail { get; set; } = string.Empty;
- Example:
ZenithArch.Abstractions.Enums
ArchitecturePattern: Selects CQRS, Repository, or FullStack generation topology.- Example:
Pattern = ArchitecturePattern.FullStack
- Example:
ArchitectureProfile: Applies starter flag presets.- Example:
Profile = ArchitectureProfile.RepositoryQuickStart
- Example:
CqrsSaveMode: Controls write persistence timing.- Example:
CqrsSaveMode = CqrsSaveMode.PerRequestTransaction
- Example:
ZenithArch.Abstractions.Interfaces
IAggregateRoot: Aggregate marker with domain-event buffer contract.- Example:
public partial class Order : EntityBase, IAggregateRoot { }
- Example:
IDomainEvent: Domain event contract with occurrence timestamp.- Example:
public sealed record TripCreated(Guid TripId) : DomainEvent;
- Example:
IAuditable: Audit metadata contract.- Example:
public DateTime CreatedAt { get; set; }
- Example:
ISoftDelete: Soft-delete contract.- Example:
public bool IsDeleted { get; set; }
- Example:
ISpecification<T>: Query specification contract.- Example:
public Expression<Func<Trip, bool>>? Criteria { get; }
- Example:
ISecurityContext: User/tenant context abstraction.- Example:
public string? UserId => _http.User.Identity?.Name;
- Example:
IZenithArchExecutionObserver: Runtime observer hooks for telemetry.- Example:
public void OnValidationFailed(string requestName, int failureCount) { ... }
- Example:
ZenithArch.Abstractions.Base
EntityBase: Aggregate base type withId, domain event buffering, and clear operations.- Example:
public partial class Trip : EntityBase { }
- Example:
DomainEvent: Base immutable domain event record.- Example:
public sealed record TripUpdated(Guid TripId) : DomainEvent;
- Example:
Configuration
ArchitectureAttribute options
| Option | Type | Default | Valid values |
|---|---|---|---|
Profile |
ArchitectureProfile |
Custom |
Custom, CqrsQuickStart, RepositoryQuickStart, FullStackQuickStart |
Pattern |
ArchitecturePattern |
Cqrs |
Cqrs, Repository, FullStack |
UseSpecification |
bool |
false |
true / false |
UseUnitOfWork |
bool |
false |
true / false |
EnableValidation |
bool |
false |
true / false |
GenerateDependencyInjection |
bool |
false |
true / false |
GenerateEndpoints |
bool |
false |
true / false |
EnableExperimentalEndpoints |
bool |
false |
true / false |
GenerateDtos |
bool |
false |
true / false |
GenerateEfConfigurations |
bool |
false |
true / false |
GenerateCachingDecorators |
bool |
false |
true / false |
GeneratePagination |
bool |
false |
true / false |
DbContextType |
Type? |
null |
Any DbContext type |
CqrsSaveMode |
CqrsSaveMode |
PerHandler |
PerHandler, PerRequestTransaction |
Feature dependency expectations
- CQRS or FullStack generation:
MediatR - Validation generation:
FluentValidation - Persistence generation:
Microsoft.EntityFrameworkCore - Endpoint generation:
Microsoft.AspNetCore.App - Caching decorators:
Microsoft.Extensions.Caching.*
Versioning Policy
Zenith Arch follows SemVer (MAJOR.MINOR.PATCH).
- Breaking public API changes require a major version bump.
- New backward-compatible capabilities use a minor version bump.
- Backward-compatible fixes and process improvements use a patch bump.
Full change history: CHANGELOG.md
Contributing
Issues and pull requests are welcome.
- Open an issue with repro steps and expected behavior.
- Fork and create a feature branch.
- Add tests for behavior changes.
- Submit a pull request with changelog updates.
Contribution guidelines: CONTRIBUTING.md
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 150 | 4/26/2026 |
ZenithArch 1.0.0: migration baseline for standardized NuGet process, SemVer governance, XML API docs, characterization tests, and CI tag-based publishing. Full changelog: https://github.com/tuanngp/ZenithArch/blob/main/CHANGELOG.md