mstrand
mstrand

Reputation: 3083

How to specify which OData version to return from a WCF Data Service

Is it possible to specify which DataServiceVersion to return from my WCF Data Service? As it is now even if I specify V2 by using

config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;

calls to the service still returns DataServiceVersion: 1.0;

Upvotes: 0

Views: 315

Answers (1)

Vitek Karas MSFT
Vitek Karas MSFT

Reputation: 13320

The server will return the lowest possible version for the given response. So if the response contains only V1 features, then it will be V1.

The client can override this by sending the MinDataServiceVersion header in which case the server will send the response of the version at least that high. This was only implemented in WCF DS 5.0 and higher though.

Upvotes: 2

Related Questions