ASP.NET Web API Gets OData v4.0 Support, WCF Will Not

ASP.NET Web API 2.2 for OData v4.0 are now available as nightly builds. The team alsoreleased OData core libraries version 6.1 on nuget with several bug fixes and new features, especially increased support for OData v4 spec. However, the MS team suggested that WCF will not get OData v4 specific features.

OData v4.0 and OData JSON Format v4.0 were recently adopted as an OASIS standard. You can read what is new in OData v4.0.

Following are the improvements in both ASP.NET Web API 2.2 and the OData core libraries -

  • Protocol and format changes from V3 to V4
  • OData attribute routing
  • Support for defining functions in OData model and binding them to controller actions
  • Model aliasing - allowing different names for types or properties of OData models and CLR Types
  • Ability to define which properties of the model can be filtered, sorted, expanded or navigated across
  • Support for ETags
  • Support for Enums
  • Support for $format query string option so client can specify the format
  • Singleton support
  • Containment support

Known limitations -

  • There are many OData v4 featuers that are still not supported - the main focus of the release was feature parity with earlier release along with few new features
  • OData core libraries are capable of serializing the OData v4 Atom format but this is not officially supported since Atom specification is not at CS2 stage yet.

On the client side, there is a new package that supports only OData v4.0 - if your client needs to consume both V1-3 and V4 services, then you'll have to use both the new and the old packages in your application.

A somewhat controversial decision is to reduce investments in making WCF a stack for building OData services. This is what the OData Services team had to say -

..we do plan to reduce investment in WCF Data Services as a stack for creating OData services. To mitigate the inconvenience this may cause, we are working on cleaning up the code and making it compatible with OData v4, and will then release that stack as open source. We do not plan to put any significant investment into adding v4-specific features to the WCF DS stack.

The community, however, wants WCF to support OData 4.0. Says Adam -

As our business tier is written in WCF DS, I feel that we have been thrown under the bus on this decision. We have invested so much effort in working around the weaknesses of WCF DS (prop change tracking, performance, containment, hackish T4 support for client proxies, terrible EF6 alpha quality provider, etc) and have been happily awaiting your new v4 release only to find out at this stage that you are abandoning it. Switching to Web API at this point seems like we pay the price for every decision you make. We are a Gold MS Partner.

Others have also requested that for OData v4.0 support in WCF. We can only wait and watch whether Microsoft changes it's decision on this.

You can get started with writing an OData v4.0 service and use the OData Client Code Generator to generate client-side proxy classes.

posted on   荣锋亮  阅读(307)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示