-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_OS
-
Fix Version/s: V4.01_CSD02
-
Component/s: CSDL XML
-
Labels:
-
Environment:
Applied
-
Proposal:
-
Resolution:
This combination is not explicitly covered in the specification.
There are two sides to this problem:
- target entity sets for contained entities
- contained entity sets as target entity sets
Both problems can be solved by allowing <NavigationPropertyBinding> elements as children of the structured type that defines the containment navigation property.
Example 1: navigation property of a contained entity targets a top-level entity set:
<NavigationProperty Name="Items" Type="Collection(Model.OrderItem)" ContainsTarget="true" />
<NavigationPropertyBinding Path="Items/Product" Target="Model.Container/Products"/>
Example 2: assume an Order contains Items and Shipments, and an Item refers to a single Shipment of the same Order and vice versa. Using paths that start at the type defining the containment navigation property, the Target would be "Shipments" and "Items".
<EntityType Name="Order">
<NavigationProperty Name="Items" Type="Collection(Model.OrderItem)" ContainsTarget="true" />
<NavigationPropertyBinding Path="Items/Shipment" Target="Shipments"/>
<NavigationProperty Name="Shipments" Type="Collection(Model.Shipment)" ContainsTarget="true" />
<NavigationPropertyBinding Path="Shipments/ShippedItems" Target="Items"/>
</EntityType>
<EntityType Name="OrderItem">
<NavigationProperty Name="Shipment" Type="Model.Shipment" Partner="ShippedItems"/>
</EntityType>
<EntityType Name="Shipment">
<NavigationProperty Name="ShippedItems" Type="Collection(Model.OrderItem)" Partner="Shipment"/>
</EntityType>