I have a base class:
class ARBase<T> : ActiveRecordValidationBase<T> where T : class
{
}
and several child classes
class Producent : ARBase<Producent>
{
}
class Supplier : ARBase<Supplier>
{
}
Now in another class I want to have a property like:
public IList<ARBase<Object>> MyCollection
{
}
and you want to be able to assign a collection of suppliers or a collection of Producent, but I get an error: cannot cast List<Producent>to IList<ARBase<Object>>...
Does anyone know a solution?
source
share