Hello, everyone!
Next, I created an abstract class called Tables, where basic system table classes inherit from this abstract class. Like Neighborhood, City, States, category, etc ... The abstract class code looks like this:
public abstract class Tabelas
{
public int Id { get; set; }
public string Nome { get; set; }
public virtual int IdEstado { get; set; }
public virtual int IdCidade { get; set; }
}
It turns out that, for example, the Category class that inherits from the abstract, does not contain the IdState and IdCity fields. But when instantiating it, the object references (accesses) these two properties. The same happens with the Neighborhood Class, where it is to access only IdCity, access also IdEstado. How to implement this in a more performative way? I need to create two new abstract classes with IdEst and IdCity respectively, or not to define these two attributes in the abstract class, but to define only in the derived class?
Sorry if I was confused.
Thank you.