-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_ERRATA02
-
Fix Version/s: V4.01_WD01
-
Labels:None
-
Environment:
[Proposed]
-
Proposal:
-
Resolution:
Today we allow types to derive from base types and define new properties, but we don't allow overriding existing complex typed properties with derived complex typed properties.
That means I can define a type FOO with property bar of type BAR:
<EntityType Name="FOO" IsAbstract="True">
<Property Name="bar" Type="ns.BAR"
</EntityType>
<ComplexType Name="BAR">
<Property Name="property1" Type="Edm.String"/>
</ComplexType>
I can define type FOO2 that adds required properties to FOO, and I can define type BAR2 that adds required properties to BAR:
<EntityType Name="FOO2" BaseType="ns.FOO">
<Property Name="requiredOnFOO2" Type="Edn.String" Nullable="false"/>
</EntityType>
<ComplexType Name="BAR2" BaseType="ns.BAR">
<Property Name="requierdpropertyOnBAR2" Type="Edm.String" Nullable="false"/>
</ComplexType>
But I can't add require that instances of FOO2 have the required properties of BAR2 (i.e., that property bar be of type BAR2).
What we would need to do in order to support this is to allow a property in a derived type to override a complex-typed property of the base type with a complex type that is derived from the type of the property in the base type.
For example:
<EntityType Name="FOO2" BaseType="ns.FOO">
<Property Name="bar" Type="ns.BAR2" />
</EntityType>
The definition of "bar" in FOO2 overrides the definition of "bar" in FOO, meaning that any property "bar" of an instance of FOO2 must be of type BAR2.