News

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 OData.org 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 Nuget.org 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

http://localhost:5001/odata/Books(2) 

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

Featured

  • C# Slides in Usage Ranking of Programming Languages

    "The fact that C# lost three places in the ranking of language communities during the last three years is mostly explained by its slower growth compared to C/C++ and PHP."

  • Telerik UI for Blazor Updated

    Progress announced an update to its Telerik UI for Blazor components, targeting Microsoft's open source Blazor framework that lets C# coders create web apps without having to rely upon JavaScript.

  • Infragistics Unveils UI Components for Blazor

    Infragistics, specializing in third-party UI/UX controls and tools, unveiled a new offering targeting Blazor, Microsoft's red-hot open source framework that allows for C#-based web development instead of traditional mainstay JavaScript.

  • AWS Open Sources Tool for Porting .NET Framework Apps to .NET Core

    Leading cloud computing platform Amazon Web Services open sourced the it announced in July for helping users port old .NET Framework applications to the new .NET Core framework.

  • Uno Platform Ports Windows Calculator to Linux

    Uno Platform has ported the famed Windows Calculator, open sourced last year, to Linux as part of a continuing "proof point" effort to demonstrate the reach of what it describes as the sole UI offering available to target Windows, WebAssembly, iOS, macOS, Android and Linux with single-codebase applications coded in C# and XAML.

Upcoming Events