Do I have to downcast when subclassing and referring to a property for a EntityCollection?
Looking at the generated code in my subclass file
/// <summary>
/// Gets the EntityCollection with the related entities of type 'MyTraceSetEntity' which are related to this entity via a relation of type '1:n'.
/// If the EntityCollection hasn't been fetched yet, the collection returned will be empty.
/// </summary>
[TypeContainedAttribute(typeof(MyTraceSetEntity))]
public override EntityCollection<TraceSetEntity> TraceSets
{
get
{
EntityCollection<TraceSetEntity> toReturn = base.TraceSets;
toReturn.EntityFactoryToUse = new MyTraceSetEntityFactory();
return toReturn;
}
}
I can see that the collection will now use the entity factory for the subtype, but it's overriding EntityCollection<TraceSetEntity> from the parent, so anytime I get this collection, will it be typed for the base entity? I think the answer is yes, and I know I could find out in a few minutes once my code compiles, but I'm not there yet, so I thought I'd ask this on the forum (apologies).