Microsoft Engineer: 'It's Time to Move OData to .NET 5'

Microsoft engineer Sam Xu says "it’s time to move OData to .NET 5" and in a new blog post he shows how to do just that.

Xu, a senior software engineer for OData and a few other properties, provided guidance on how to move the BookStore sample that was used in the July 2018 introduction of OData in ASP.NET Core 2.0.

OData, short for Open Data Protocol, was introduced by Microsoft in 2007 and subsequently became an OASIS standard that "enables the creation and consumption of REST APIs, which allow Web clients to publish and edit resources, identified using URLs and defined in a data model, using simple HTTP messages."

The site says "OData helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc. OData also provides guidance for tracking changes, defining functions/actions for reusable procedures, and sending asynchronous/batch requests."

Having been part of ASP.NET Core for nearly two years now, OData will also be part of the upcoming (November 2020) release of .NET 5, a unification of all things .NET into one platform that can be used to target Windows, Linux, macOS, iOS, Android, tvOS, watchOS and WebAssembly and more. The second preview of .NET 5 shipped last week.

.NET 5
[Click on image for larger view.] .NET 5 (source: Microsoft).

"We encourage you to download the latest ASP.NET Core OData package from and start building amazing OData service running on any .NET 5 platforms, such as Windows, MacOS and Linux," Xu said in an April 6 blog post.

In that post, Xu explains in detail how to move the ASP.NET Core Bookstore project to .NET 5. The process involves tweaking the BookStore.csproj and Startup.cs files -- after installing the .NET 5 SDK and Visual Studio 2019 v16.6 Preview.

Those tweaks allow for simple GET requests such as


to retrieve the second book from a list, along with advanced queries such as

http://localhost:5001/odata/Books?$filter=Price le 50&$expand=Press($select=Name)&$select=ISBN,Location($select=Street)

Xu's resulting project -- BookStoreDotNet5 -- is now available on GitHub.

And that's not the only development work that Microsoft has been doing around OData, as it recently announced the release of OData Connected Service 0.7.1.

Available as a Visual Studio extension in the IDE's marketplace, OData Connected Service is described as a tool used to generate code to facilitate consumption of OData services by creating a DataServiceContext and classes for the entity types and complex types found in the service description.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


  • .NET Core Ranks High Among Frameworks in New Dev Survey

    .NET Core placed high in a web-dominated ranking of development frameworks published by CodinGame, which provides a tech hiring platform.

  • Here's a One-Stop Shop for .NET 5 Improvements

    Culled from reams of Microsoft documentation, here's a high-level summary of what's new for performance, networking, diagnostics and more, along with links to the nitty-gritty details for those wanting to dig in more.

  • Azure SQL Database Ranked Among Top 3 Databases of 2020

    Microsoft touted the inclusion of Azure SQL Database among the top three databases of 2020 in a popularity ranking by DB-Engines, which collects and manages information about database management systems, updating its lists monthly.

  • Time Tracker Says VS Code Is No. 1 Editor for Devs, Some Working 15+ Hours Per Day

    WakaTime, which does time tracking for programmers, released data for 2020 showing that Visual Studio Code is by far the top editor/IDE used by its coders, some of whom are hacking away for more than 15 hours per day.

Upcoming Events