Consider the following simple relationship.Code[DataContract(Name = Wheel)]public class Wheel { }[DataContract(Name = OffRoadWheel)]public class OffRoadWheel : Wheel { }[DataContract(Name = RoadVehicle)]public class RoadVehicle{    public Collection<Wheel> Wheels { get; private set; }    public RoadVehicle()    {        Wheels = new Collection<Wheel>();    }}[DataContract(Name = Truck)]public class Truck : RoadVehicle{    public Collection<OffRoadWheel> OffRoadWheels { get; private set; }    public Truck()    {        OffRoadWheels = new Collection<OffRoadWheel>();    }}The Collections are configured as Read-Only and initiated in the class constructor as per FXCop recommendation CAS2227. http://msdn.microsoft.com/en-us/library/ms182327(VS.80).aspxNow I know all the rules about Covariance & Contravariance, and the varying capabilities of using Collections vs. Lists vs. Enumerables (vs. their Interface Equivalents). However the above object model creates a number of competing difficulties.If you create a truck with 4 Off-Road Wheels, down cast it to a RoadVehicle, and then iterate the Wheels collection... it's empty.One way around this would be to create a public new Collection<Wheel> Wheels property on the Truck class which on-the-fly casts the contents of the OffRoadWheel collection, but this breaks behaviour if you go to add or remove on that collection.Another problem is serialization, you can alter the above to store and duplicate the inner Wheels and OffRoadWheels properties, but then you'd end up complete serializing both if you wanted to serialize TruckAny other suggestions on how to make this more Developer Friendly object model where things happen as you'd expect them to?
How would you improve this object model design to get around Covariance Issues with ObjectModel.Collection?
c#;collections;generics;inheritance