Defining the domain layer interface
Once the PackagesManagementDomain
Standard 2.1 library project has been added to the solution, we’ll add a Tools
folder to the project root. Then, we’ll place all the DomainLayer
tools contained in the code associated with ch7
. Since the code contained in this folder uses data annotations and defines DI extension methods, we must also add references to the System.ComponentModel.Annotations
and Microsoft.Extensions.DependencyInjection.Abstration
NuGet packages.
Then, we need an Aggregates
folder containing all the aggregate definitions (which, as already said, we will implement as interfaces).
Below is an example of an aggregate definition:
public interface IPackage : IEntity<int>
{
void FullUpdate(IPackageFullEditDTO packageDTO);
string Name { get; set; }
string Description { get;}
decimal Price { get; set; }
int DurationInDays { get; }
DateTime? StartValidityDate { get;}
DateTime? EndValidityDate...