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

ASP.NET Web API 2.2及OData核心库已发布夜间构建版本,支持OData v4规范。新版本包括协议变更、属性路由等特性,并增强了对OData v4的支持。但Microsoft计划减少对WCF Data Services的投资,引起社区讨论。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值