Skip to content
This repository has been archived by the owner on Feb 2, 2020. It is now read-only.
Michał B edited this page Feb 10, 2018 · 13 revisions

Description

  • 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.

Properties

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 Virtual brand variable for 'one to many' relationship in Entity Framework Core.
Projects List<Project> public Virtual list of projects for 'one to many' relationship in Entity Framework Core.

Methods

Name Type Access Description
Car - public Constructor initializing all object fields, including those related to Entity Framework Core.
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.
SetModel void private A method for validating and setting the model name. Throws an ForbiddenValueException if the name of the brand does not pass the validation.
SetHorsepower void private A method for validating and setting the number of horsepower. Throws an ForbiddenValueException if the name of the brand does not pass validation.
SetGeneration void private A method for validating and setting the generation number. Throws an ForbiddenValueException if the name of the brand does not pass validation.
Equals bool public An overridden method to check if two objects are equal.
IsEqual bool private A method that compares two objects for equality. Used by the Equals() method.
GetHashCode int public An overridden method that returns the object's hashcode.

General


Technical documentation

  1. Models
Clone this wiki locally