[Announcement] The ASP.NET Web API 2.2 for OData release and the OData Client Code Generator release

We are very excited to announce the availability of nightly builds on MyGet for ASP.NET Web API 2.2 for OData v4.0 along with OData Client Code Generator for writing OData v4 clients. The Web API 2.2 release is particularly noteworthy as it is the first Web API release with support for OData v4 with selected highly demanded features. For a summary of what’s new in OData v4.0, please visit What’s New in OData v4.

What’s New in ASP.NET Web API 2.2 for OData v4.0

New features

  1. Protocol and format changes from V3 to V4.
  2. OData attribute routing: This release allows you to define the routes in your controllers and actions using attributes.
  3. Support for functions: This release allows you to define functions in your OData model and bind them to actions in your controller that implement them.
  4. Model aliasing: This release allows to change the names of the types and properties in your OData model to be different than the ones in your CLR types.
  5. Support for limiting allowed queries: This feature release the service to define limitations on the properties of the model that can be filtered, sorted, expanded or navigated across.
  6. Support for ETags: This release allows to generate an @odata.etag annotation based on some properties of the entity that can be used in IfMatch and IfNoneMatch headers in following requests.
  7. Support for Enums: Improved our support for Enums and now we support them as OData enumerations.
  8. Support for $format: Added support for $format, so clients are able to specify the desired format of the response in the URL.

Where to get it

It is now available at ASP.NET Web API 2.2 for OData v4.0 on MyGet. We recommend version v5.2.0-alpha1-140307 as a good place to start kicking the tires or go ahead and try the latest greatest. Please refer to the instructions on how to use nightly builds on our CodePlex site.

Sample codes

We have provided a comprehensive list of OData v4.0 service samples to accelerate your own v4.0 service implementation. They are available at https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/OData/v4/

Tutorial Blog


OData Client Code Generator to Support OData v4.0 Spec

New Features

  1. OData v4.0 Spec:  This release is able to generate C# and VB .NET client-side proxy classes to consume an OData V4 service.
  2. Enum Support:  This release supports generating the codes of enum values and properties for OData Client library.
  3. Singleton Support:  This release supports generating the codes of singleton values. You could now compose a LINQ query using singletons values.


We support the Professional, Premium, and Ultimate versions of Visual Studio 2010, 2012, 2013.

Where to get it


Blog and Tutorial


Call to Action

If your team has an existing OData service or is considering adding an OData service or migrating your V3 service to V4, now is an excellent time to engage with us. For any feature request, issues or ideas please feel free to reach out to us at odatafeedback@microsoft.com.



The OData Team

Comments (7)

  1. Onur says:

    Can you allow us to use our private fields for ODATA? We have some entities with getters and private backing fields and we want to use exactly the same entities not some generated code. Unfortunately OData Client only checks for public fields. For the last 10 years, generated code was the main problem in all Microsoft products such as, Typed DataSets, Linq To Sql, Entity Framework (without code first), RIA Services. All of these products failed since all rely on some sort of code generation.

  2. Bejarid says:

    Code generation is what the modern developpement plateform have to help you to be more productive. .Net use code generation from the start (it generate IL from any CLS-compatible languages).

    If you don't want it at all as you say, stay with C++. Do not use .Net or Javascript or anythings like that.

  3. Stephen says:

    What about WCF Data Services?  Is there a least a post announcing why it is not going to be supported anymore?

  4. ImGonaRot says:

    The Web API 2.2 OData v4.0 supports functions defined on the model and the metadata show the supported functions but the T4 template does not generate any code based on this new OData v4.0 feature. Will functions be supported in the new proxy generated code?

  5. ImGonaRot says:

    This same problem exists in 6.3 of the OData client. Also not all functions have this problem it is only when the return type of the function is of a class different than the class it is bound to through the WebApiConfig class. See my post here for full details.


  6. @ImGonaRot Sat, Apr 26 2014 1:40 PM #

    The action & function generation will be supported in the next release of OData Client Code Generator.

  7. Zhisheng says:

    Support for limiting allowed queries: This feature release the service to define limitations on the properties of the model that can be filtered, sorted, expanded or navigated across.

    Is it discoverable by client? i.e., does the metadata indicates if a column is not sortable or can't be filtered?