August 2017
Intermediate to advanced
330 pages
7h 26m
English
We create the models in a separate project, as we want don't want to pollute the API project with everything, it's not a dumping ground. When we create classes, one class has one responsibility and, as soon as they have more than one responsibility, we create this into a new class. Projects should contain classes that have, and share, the same responsibility. We also create a BaseModel class that has some common attributes that we want all our models to have and which they should have, because they are related.
public class BaseModel
{
public Guid Id { get; set; }
}
After creating the models project, we have a folder with the model class and our BaseModel class:
The StoreModel class inherits from the BaseModel class and the properties ...