This repository has been archived by the owner on Feb 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Car
Michał B edited this page Feb 10, 2018
·
13 revisions
- This class describes a mass-produced car for the knowledge base.
- This class is responsible for modeling the table representation in the database.
- This class contains methods responsible for acting on it.
- This class inherits from the Entity class.
Name | Type | Access | Description |
---|---|---|---|
BrandName | string | public | The name of the car brand |
Model | string | public | The name of the car model |
Horsepower | int | public | The number of horsepower of the car |
Generation | int | public | The car's generation number |
ProductionDate | DateTime | public | Date of car production. |
BrandId | Guid | public | Brand ID for relationship in Entity Framework. |
Brand | Brand | public | Brand ID for 'one to many' relationship in Entity Framework Core. |
Projects | List<Project> | public | List of projects for 'one to many' relationship in Entity Framework Core. |
Name | Type | Access | Description |
---|---|---|---|
Car() | - | public | Constructor initializing all object fields, including those related to EF. |
Update() | void | public | The method used to update the model, horsepower, generation and date of production. |
SetBrandName() | void | private | A method for validating and setting the brand name. Throws an ForbiddenValueException if the name of the brand does not pass the validation. |