OData / lab

This repository is for exploring new ideas and developing early prototypes of various OData stacks.
Other
48 stars 59 forks source link

[Connected Service] Set the max protocol version of the generated client #91

Closed groovyfeng closed 5 years ago

groovyfeng commented 5 years ago

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

chuanboz commented 5 years ago

that will be the same issue for OData v4 generated client, in additional to the old v3 clients.

groovyfeng commented 5 years ago

The generated client will call the right constructor and set the DataServiceProtocolVersion to V3 if EDMX specifies the MaxDataServiceVersion attribute.