What's New in ASP.NET Web API OData 5.3

by Microsoft

This topic describes what's new for ASP.NET Web API OData 5.3.


The runtime features are released as NuGet packages on the NuGet gallery. You can install or update to the released NuGet packages by using the NuGet Package Manager Console:

Install-Package Microsoft.AspNet.OData -Version 5.3.0 
Install-Package Microsoft.AspNet.WebApi.OData -Version 5.3.0


You can find tutorials and other documentation about ASP.NET Web API OData at the ASP.NET web site.

OData Core Libraries

For OData v4, Web API now uses ODataLib version 6.5.0

New Features in ASP.NET Web API OData 5.3

Support for $levels in $expand

You can use the $levels query option in $expand queries. For example:


This query is equivalent to:


Support for Open Entity Types

An open type is a structured type that contains dynamic properties, in addition to any properties that are declared in the type definition. Open types let you add flexibility to your data models. For more information, see xxxx.

Support for dynamic collection properties in open types

Previously, a dynamic property had to be a single value. In 5.3, dynamic properties can have collection values. For example, in the following JSON payload, the Emails property is a dynamic property and is of collection of string type:

   "Id": 1,
   "Name": "Ben",
   "Emails@odata.type": "#Collection(Edm.String)",
   "Emails": [

Support for inheritance for complex types

Now complex types can inherit from a base type. For example, an OData service could define the following complex types:

public abstract class Shape
    public bool HasBorder { get; set; }

public class Point
    public int X { get; set; }
    public int Y { get; set; }

public class Circle : Shape
    public Point Center { get; set; }
    public int Radius { get; set; }

    public override string ToString()
        return "{" + Center.X + "," + Center.Y + "," + Radius + "}";

public class Polygon : Shape
    public IList<Point> Vertexes { get; set; }
    public Polygon()
        Vertexes = new List<Point>();

Here is the EDM for this example:

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
    <Schema Namespace="ODataComplexTypeInheritanceSample" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <ComplexType Name="Shape" Abstract="true">
        <Property Name="HasBorder" Type="Edm.Boolean" Nullable="false" />
      <ComplexType Name="Polygon" BaseType="ODataComplexTypeInheritanceSample.Shape">
        <Property Name="Vertexes" Type="Collection(ODataComplexTypeInheritanceSample.Point)" />
      <ComplexType Name="Point">
        <Property Name="X" Type="Edm.Int32" Nullable="false" />
        <Property Name="Y" Type="Edm.Int32" Nullable="false" />
      <ComplexType Name="Circle" BaseType="ODataComplexTypeInheritanceSample.Shape">
        <Property Name="Center" Type="ODataComplexTypeInheritanceSample.Point" />
        <Property Name="Radius" Type="Edm.Int32" Nullable="false" />
      <EntityContainer Name="Container">

For more information, see OData Complex Type Inheritance Sample.

Known Issues and Breaking Changes

This section describes known issues and breaking changes in the ASP.NET Web API OData 5.3.

OData v4

Query Options

Issue: Using nested $expand with $levels=max results in an incorrect expansion depth.

For example, given the following request:


If MaxExpansionDepth is 5, this query would result in an expansion depth of 6.

Bug Fixes and Minor Feature Updates

This release also includes several bug fixes and minor feature updates.

ASP.NET Web API OData 5.3.1

In this release we made a bug fix to some of the AllowedFunctions enums. This release doesn't have any other bug fixes or new features.