-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_CS01
-
Fix Version/s: V4.0_CSD03
-
Component/s: CSDL XML, Vocabularies
-
Labels:None
-
Environment:
[Applied]
-
Proposal:
-
Resolution:
The OptimisticConcurrencyControl term in the Core vocabulary currently defines a complex type that contains a single collection-valued property:
<Term Name="OptimisticConcurrencyControl" Type="Core.OptimisticConcurrencyControlType" AppliesTo="EntitySet">
<Annotation Term="Core.Description" String="If present, the annotated entity set uses optimistic concurrency control" />
</Term>
<ComplexType Name="OptimisticConcurrencyControlType">
<Property Name="ETagDependsOn" Type="Collection(Edm.PropertyPath)" Nullable="true">
<Annotation Term="Core.Description" String="The ETag is computed from these properties" />
</Property>
</ComplexType>
This intermediate complex type means that applying the vocabulary requires an extra <Record> and <PropertyValue> wrapper:
<EntitySet Name="Entities" Type="Self.Entity">
<Annotation Term="Core.OptimisticConcurrencyControl">
<Record>
<PropertyValue Name="ETagDependsOn">
<Collection>
<PropertyPath>LastModified</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</EntitySet>
This is unnecessarily cumbersome. We can remove the extra complex type and just create a term whose type is Collection(Edm.NavigationPropertyPath), as in:
<Term Name="OptimisticConcurrencyControlProperties" Type="Collection(Edm.PropertyPath)" AppliesTo="EntitySet">
<Annotation Term="Core.Description" String="The set of properties that are used to compute the ETag" />
</Term>
Which would be applied much more simply as:
<EntitySet Name="Entities" Type="Self.Entity">
<Annotation Term="Core.OptimisticConcurrencyControlProperties">
<Collection>
<PropertyPath>LastModified</PropertyPath>
</Collection>
</Annotation>
</EntitySet>
I think these annotations will be common, so having a simpler way to express is significant.