Closed groovyfeng closed 5 years ago
that will be the same issue for OData v4 generated client, in additional to the old v3 clients.
The generated client will call the right constructor and set the DataServiceProtocolVersion to V3 if EDMX specifies the MaxDataServiceVersion attribute.
To set the max protocol version of the generated client, the version need to passed in to the constructor of DataServiceContext:
public DataServiceContext(Uri serviceRoot, DataServiceProtocolVersion maxProtocolVersion);
However, the generated client code only uses the constructor without it:
public AccountServiceClient(global::System.Uri serviceRoot) : base(serviceRoot)
There is no way for us to change the max protocol version with the generated code. Could we have the code generator to add a client constructor that takes the max protocol version as a parameter? Like:
public AccountServiceClient(global::System.Uri serviceRoot, global::System.Data.Services.Common.DataServiceProtocolVersion) : base(serviceRoot, maxProtocolVersion)
Thanks