If you want to use Request.GetETag()
in an action, you must call ActionConfiguration.ReturnsFromEntitySet()
, or
Request.GetETag()
will return null
.
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="Default" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EntityType Name="Customer">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Id" Type="Edm.Int32" Nullable="false"/>
<Property Name="Version" Type="Edm.Int32" Nullable="false"/>
<Property Name="Name" Type="Edm.String" Nullable="false"/>
</EntityType>
<Action Name="ThisWorks" IsBound="true">
<Parameter Name="bindingParameter" Type="Default.Customer"/>
<ReturnType Type="Default.Customer" Nullable="false"/>
</Action>
<Action Name="ThisFails" IsBound="true">
<Parameter Name="bindingParameter" Type="Default.Customer"/>
</Action>
<EntityContainer Name="Container">
<EntitySet Name="Customers" EntityType="Default.Customer">
<Annotation Term="Org.OData.Core.V1.OptimisticConcurrency">
<Collection>
<PropertyPath>Version</PropertyPath>
</Collection>
</Annotation>
</EntitySet>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>