A Domain Driven shared library, containing basic components for setting up a domain. Contains base classes for AggregateRoots, Entities, and value objects. These each have proper overrides for Equals, ==, and !=. This package also includes interfaces for setting up domain events as well as interfaces for using a repository pattern. This is an open source project please feel free to do a pull request on the github repo.
$ dotnet add package EXCSLA.Shared.Core.SpecificationsSpecification pattern implementation for query criteria composition in the EXCSLA framework.
Implements the Specification pattern for building complex, reusable query criteria without polluting domain models.
dotnet add package EXCSLA.Shared.Core.Specifications
public class UndeliveredOrdersSpec : Specification<Order>
{
public UndeliveredOrdersSpec(DateTime since)
{
Query
.Where(o => o.Status == OrderStatus.Pending &&
o.CreatedAt >= since)
.Include(o => o.Customer)
.Include(o => o.Items)
.OrderBy(o => o.CreatedAt);
}
}
// Usage in repository
var spec = new UndeliveredOrdersSpec(DateTime.UtcNow.AddDays(-7));
var orders = await repository.ListAsync(spec);
See LICENSE file in repository
For issues and questions, visit the GitHub repository