ASP. NET Web API 2.2 for OData v4.0 daily build version is now released. The Team also released OData core library version 6.1 on nuget, which contains several Bug fixes and new features, especially added support for OData v4 specifications. However, Microsoft's team said that WCF would not obtain the unique features of OData v4.
Recently, OData v4.0 and OData JSON Format v4.0 have been adopted as an OASIS standard. You can view the new functions of OData v4.0.
The following are improvements to ASP. NET Web API 2.2 and OData core libraries:
* Protocol and format changed from V3 to V4
* OData attribute Routing
* Supports defining functions in the OData model and binding them to the Controller.
* Model alias -- allows the OData model and CLR Types to have different Types or attributes.
* You can define the attributes of a model that can be filtered, sorted, expanded, or navigated.
* Supports ETags.
* Enumeration supported
* The $ format query string option is supported, so the client can specify the format
* Support Singleton
* Supported include
Known limitations:
Many other OData v4 features are not supported-the focus of this release is the same features as earlier versions and a few new features
The OData core library can serialize the OData v4 Atom format. However, since the Atom specification has not yet entered the CS2 stage, this is not officially supported.
On the client side, there is a new package, but only supports OData v4.0 -- if the client needs to use V1-3 and V4 services, then developers have to use both the new and old packages in the application.
A controversial decision is to reduce investment in making WCF a technology stack for building OData services. The OData Services team said this, "... For the WCF Data Services used to create the OData service technology stack, we do plan to reduce investment in it. To reduce the inconvenience caused, we are trying to clean up the code so that it is compatible with OData v4. Later, we will open-source the technology stack. We do not plan to make any significant investment in adding the unique features of V4 to the wcf ds technology stack ."
However, the Community still hopes that WCF can support OData 4.0. Adam said: "Since our business layer is compiled using the wcf ds, I think we are thrown away from this decision. We have spent so much effort to overcome the weaknesses of the wcf ds (poor T4 support for change tracking, performance, inclusion, client proxy, and poor EF6 alpha quality providers ), happy to wait for the release of the new version v4, but now you have abandoned it. Switching to the Web API at this time seems like we pay for each of your decisions. We are Microsoft's golden partner ."
Others require that OData v4.0 be supported in WCF. We can only wait and see if Microsoft will change this decision.
You can start by writing an OData v4.0 service and use the OData client code generator to generate the client proxy class.