- .NET 6
- Docker (optionaly for databases)
- Install template
dotnet new --install NightBaker.ProjectTemplate
dotnet new CleanBlazor -n <ProjectName>
- Run and create databases with docker (or just use your databases)
cd docker
docker-compose up
- Finally, run app
As you can see, we want to share enums and exceptions from domain layer, DTOs from application layer with blazor project. Therefore, we've added extra DTO class library for each layer.
Interface stands for defining aggregate root. Therefore, IRepository can work only with aggregates as well as IUnitOfWork.
Any domain object is entity. Entity has ability to raise events.
Domain event implements INotification abstraction from Mediatr. Finally, we use mediator to publish and hand such events. We have two abstractions of event (INotification) : IPreSaveEvent and IPostSaveEvent for providing more managable behaviour. For more details, refer to Persistence layer section.
Value object is immutable object with ovverided equality methods, so they are compared by property values.