Defining the domain objects
In this section, you will learn how to define entities with ABP Framework. The domain is simple for this application. We have Product and Category entities and a ProductStockState enum, as shown in Figure 3.1:
Entities are defined in the Domain Layer of the solution, and the domain layer is split into two projects within the solution:
- ProductManagement.Domain is used to define your entities, value objects, domain services, repository interfaces, and other core domain-related classes.
- ProductManagement.Domain.Shared is used to define some primitive shared types. The types defined in this project are available to all other layers. Typically, we define enums and some constants here.
So, we can start by creating the Category
and Product
entities and the ProductStockState
enum.
Category
The Category
entity is used to categorize the products. Create a Categories...