Defining the domain layer implementation
The domain layer implementation contains the implementation of all repository interfaces and aggregate interfaces defined in the domain layer interface. In the case of .NET 8, it uses Entity Framework Core entities to implement aggregates. Adding a domain layer interface in between the domain layer’s actual implementation and the application layer decouples the application layer from EF and entity-specific details. Moreover, it conforms with the onion architecture, which, in turn, is an advised way to architect microservices.
The domain layer implementation project should contain references to Microsoft.AspNetCore.Identity.EntityFrameworkCore
and Microsoft.EntityFrameworkCore.SqlServer
NuGet packages, since we are using Entity Framework Core with SQL Server. It references Microsoft.EntityFrameworkCore.Tools
and Microsoft.EntityFrameworkCore.Design
, which is needed to generate database migrations, as explained in the Entity Framework...