Writing entities and enums
Here are quick definitions of entity and enum before we start writing them in the domain project. What is an entity? An entity is a representation of a domain object model in an application. A database translates an entity into a row in a database table. Similarly, the properties of an entity are the columns in a database table.
On the other hand, an enum is a type of class representing a set of constants or read-only variables.
We have looked at a quick definition of an entity and an enum; now, let's see them in action.
Creating entities and enums for the Travel Tour application
In your solution application, go to the Travel.Domain
project and create two directories:
Entities
Enums
The Entities
directory will be for all the Travel Tour application entities, while the Enums
directory is for all the Travel Tour application enums:
- In the
Entities
folder, create a C# file,TourPackage.cs
, and write this code:namespace...