this is strange but I really need it. I need to inherit a class without inherit their base class but I don't know how.
I have a base abstract entity class from a framework like this:
public abstract class AbstractEntity { public bool Validate(){}; public List<ValidationErrors> erros; // and so many more properties and methods } My custom class inherit this abstract base class:
public class Contact : AbstractEntity { public int id public string name; public string phone; } I'm using this class Contact on a webservice and I need only the custom properties, how can I re-use the class Contact without the inheritance AbstractEntity?
I don't want to duplicate this class. Sorry if this sounds stupid.
EDIT
This is a project already created with a code generator, I can't change the classes structures. For this reason I wanted to instantiate that class without the abstract class.
As I can not change it now and need it urgently, I will duplicate this class without the abstraction and use it.
AbstractEntityprotected so it would not be accessible outside and will not be serialized.Contactin your class?