How do I get properties from derived class in base class?
Base class:
public abstract class BaseModel {
protected static readonly Dictionary
If you require that a derived class must implement a method or property, you should introduce that method or property into the base class as an abstract declaration.
For example, for your Name
property, you would add to the base class:
public abstract string Name { get; set; }
Then any derived classes must implement it, or be abstract classes themselves.
Once you have added the abstract version of the Name
property to the base class, you will be able to access it in the base class anywhere except in the base class's constructor.