Hello guys...
I have a class Client like that:
public class Client{
public Person Pers { get; set; }
}
And I have 2 Person´s child class :
public class PersonType1 : Person {...}
public class PersonType2 : Person {...}
Now I loaded a client... And I need to get the PersonType1 or PersonType2 attributes ..
I tried that:
var _pj = ((PersonType1 ) _client.Pers);
But it does not work, because the _client.Pers type is a Proxy (Lazy load true) ...
Is there a way to do that? I have several attributes in each PersonType, so It is not a good idea to create a virtual/override for each attribute (Person->PersonType1) ...
Thanks