Majal is a C# source generator library that helps you implement Domain-Driven Design (DDD) patterns with minimal boilerplate. It provides source generators for:
- Entities (with equality and comparison helpers)
- Aggregates (domain events publishing)
- Value Objects (with equality and comparison helpers)
- Archivables (Soft-deletion)
- Auditables (Creation/Update tracking)
- Translatables (Multi-language support)
- Ordinals (Sort order)
The library ships as a Roslyn analyzer/source generator package that can be referenced from any .NET project.
<PackageReference Include="Majal" Version="<VERSION>" />The package contains the generators and the required analyzer DLL (Majal.dll).
The solution targets .NET Standard 2.0 and can be built with the .NET CLI:
# Restore packages
dotnet restore
# Build the generators
dotnet build src/Majal/Majal.csproj -c ReleaseThe generated analyzer DLL will be placed in src/Majal/bin/Debug/netstandard2.0/ (or Release folder).
The repository contains a test project (Majal.Tests). To run the unit tests:
dotnet test tests/Majal.Tests/Majal.Tests.csproj- Getting Started
- Aggregates Guide
- Entities Guide
- Value Objects Guide
- Archivables Guide
- Auditables Guide
- Translatables Guide
- Ordinals Guide
- EF Core Integration
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.