iman.Domain is the library I've built for using in DDD and CQRS based projects using .NET
and C#
.
It consist of primary building blocks for common domain-driven applications such as AggregateRoot
and Entity
.
- Support for
AggregateRoot
andEntity
with or without identity DomainEvent
for raising business events in AggregatesRepository
andService
contracts for Domain modelsValueObject
contract for implementing ValueObjects- Implementation of
Mediator
pattern - Support for
Command
,Query
andEvent
and automatically matched them with their respective handlers DomainException
contract to define business exceptions
For using Domain building blocks, you just need to reference this library and inherit from
the block you need to use in your application. But for using the Mediator, in order to
implement CQRS
pattern, you need to register iman.Domain
services in the default
.NET container, like this :
var services = new ServiceCollection();
services.AddDomainCore();
โ ๏ธ If you use any other DI container other than Microsoft.Extensions.DependencyInjection
you must register iman.Domain
services yourself.
For now, you can see the samples of the library in Tests
project, I will
add some samples very soon ;)
Feel free to fork this project, commit your codes and send pull requests.