My current code looks a little like this.
class BaseClass2
{
public List<BaseClass1> list { get; set; }
}
class DerivedClass2 : BaseClass2
{
public DerivedClass1A objA { get; set; }
public DerivedClass1B objB { get; set; }
}
What i have is a DerivedClass2 where i know the types of the list in the base class and i know there will be two types of DerivedClass1A and DerivedClass1B.
I could create new variables as above but i’d prefer not to use the memory and cleverly access and set the original list, how can i do this?
Thanks
Do you mean something like this?
That isn’t good design though… Why would you have that list? What are you really trying to do?