As discussed in the Data transfer section in Chapter 5, Web Service Stack in ASP.NET Core, the domain model is the representation of the data handled by our service. Thinking about a catalog web service for a music store, the primary data we need to process includes the entities used by the API.
To guarantee reusability and loose coupling, we are going to define the domain model of the service in a separate project. First of all, let's create a new Catalog.Domain project inside the src folder by executing the following command:
dotnet new classlib -n Catalog.Domain -f netstandard2.1
The above command also specifies the netstandard2.1 version as target framework. Furthermore, after creating the Catalog.Domain project, we need to add it to our solution:
dotnet sln ../Catalog.API.sln add Catalog.Domain
The preceding instruction adds a reference...