RynorArch.Generator
1.0.8
dotnet add package RynorArch.Generator --version 1.0.8
NuGet\Install-Package RynorArch.Generator -Version 1.0.8
<PackageReference Include="RynorArch.Generator" Version="1.0.8"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="RynorArch.Generator" Version="1.0.8" />
<PackageReference Include="RynorArch.Generator"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add RynorArch.Generator --version 1.0.8
#r "nuget: RynorArch.Generator, 1.0.8"
#:package RynorArch.Generator@1.0.8
#addin nuget:?package=RynorArch.Generator&version=1.0.8
#tool nuget:?package=RynorArch.Generator&version=1.0.8
RynorArch
Compile-time architecture automation for .NET with Roslyn incremental source generation.
Installation
dotnet add package RynorArch.Abstractions
dotnet add package RynorArch.Generator
For source generator usage, configure analyzer-style reference:
<ItemGroup>
<PackageReference Include="RynorArch.Abstractions" Version="1.0.8" />
<PackageReference Include="RynorArch.Generator" Version="1.0.8" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
Optional CLI installation:
dotnet tool install --global RynorArch.Cli --version 1.0.8
Quickstart
using RynorArch.Abstractions.Attributes;
using RynorArch.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.AddRynorArchDependencies();
Full API Reference
RynorArch.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:
RynorArch.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:
RynorArch.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:
IRynorArchExecutionObserver: Runtime observer hooks for telemetry.- Example:
public void OnValidationFailed(string requestName, int failureCount) { ... }
- Example:
RynorArch.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
RynorArch 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.
Learn more about Target Frameworks and .NET Standard.
This package has 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.
RynorArch 1.0.8: migration baseline for standardized NuGet process, SemVer governance, XML API docs, characterization tests, and CI tag-based publishing. Full changelog: https://github.com/tuanngp/RynorArch/blob/main/CHANGELOG.md