I have an abstract class Domain which is responsible for validation of my<snip>
model. All classes in the model inherit from Domain for operations such as
bool IsValid {get;}.
However List<Addressand List<PhoneNumberdoes not cast to List<Domain>..Yes, there's a way to do it - you need to make the method generic:
Is there a way to do this, or are there any other options other than
repeating the code?
public bool IsChildListValid<T>(List<TdomainList) where T : Domain
{
...
}
That should work with no problems.
Jon