The infrastructure layer – directory
The infrastructure layer has the class implementations of interfaces defined in the Application
project. Resources such as SMTP, filesystems, or web services are samples of the application's external dependencies but implemented in this layer.
This layer is another directory inside the solution while holding multiple projects. The projects we will add here are for data and shared projects. We can also add a project named Identity for authentication
, but we will do this in Chapter 9, Securing ASP.NET Core, to keep the structuring part of this clean architecture minimal. So here they are.
To set up the infrastructure layer, we will need two projects – Data
and Shared
.
Data – project
This part of the infrastructure layer is a .NET 5.0 class library project intended for a database. You can also name this data project to a persistence project; persistence and data are intractable.
Shared – project
This...