OData

Create and consume RESTful APIs in a simple and standard way

Latest posts

Announcing ASP.NET Core OData 10.0.0 Preview 1
Nov 27, 2025
Post comments count 2
Post likes count 1

Announcing ASP.NET Core OData 10.0.0 Preview 1

Samuel Wanjohi
Samuel Wanjohi

We're thrilled to announce the release of ASP.NET Core OData 10.0.0 Preview 1, a major modernization update that embraces .NET's native and types! This release upgrades to .NET 10.0 and replaces OData's proprietary and CLR wrapper types with .NET's native structs. What's Changed Framework & Dependency Updates .NET 10.0 Support ASP.NET Core OData now targets .NET 10.0, taking advantage of the latest runtime performance improvements and language features. OData Library 9.x and Model Builder 3.x Integration This release updates OData dependencies to align with the latest OData .NET ecosystem: ...

Announcing OData Model Builder 3.0.0 Preview 1 Release
Nov 26, 2025
Post comments count 0
Post likes count 1

Announcing OData Model Builder 3.0.0 Preview 1 Release

Samuel Wanjohi
Samuel Wanjohi

We're excited to announce that OData Model Builder 3.0.0 Preview 1 has been officially released and is available on NuGet: This is a major release that brings the library up to date with the latest .NET and OData ecosystem, featuring .NET 10 support, OData Library 9.x compatibility, and modernized date/time handling using native .NET types. What's New in OData Model Builder 3.0.0 Preview 1 Framework & Dependency Updates .NET 10 Support OData Model Builder now targets .NET 10, aligning with the latest .NET runtime and taking advantage of modern performance improvements and language features. The l...

Announcing OData .NET (ODL) 9 Preview 3 Release
Nov 21, 2025
Post comments count 0
Post likes count 2

Announcing OData .NET (ODL) 9 Preview 3 Release

John Gathogo
John Gathogo

We’re happy to announce that OData .NET (ODL) 9 Preview 3 has been officially released and is available on NuGet: What’s New in OData .NET (ODL) 9 Preview 3 The OData .NET (ODL) 9.0.0 Preview 3 introduces a set of important changes and cleanup efforts to modernize the library, align with .NET’s evolving runtime, and simplify the OData developer experience. Below, we’ll go through the notable changes included in this release. Use for Action Queries Returning a Single Item Summary We updated to avoid throwing an exception when an action returns no result. The and methods now choose ...

Announcing a new OData.NET serializer
Oct 7, 2025
Post comments count 3
Post likes count 2

Announcing a new OData.NET serializer

Clément Habinshuti
Clément Habinshuti

One of the major, recurring complaints of the OData.NET libraries is the performance overhead of the serialization stack. We have done a lot of work to improve the serialization performance, but the existing architecture limits how far we can go. For this reason, we have started work on a new serialization stack for OData.NET libraries that addresses major performance concerns and also makes general improvements to usability. We plan to ship this new serializer as part of 9.x library (the next major release) under a new namespace as an alternative to the existing and . But you don't have to wait for 9.x rel...

Enable OData functionalities on ASP.NET Core Minimal API
Oct 7, 2025
Post comments count 0
Post likes count 1

Enable OData functionalities on ASP.NET Core Minimal API

Sam Xu
Sam Xu

Introduction Minimal API is a simplified approach for building HTTP APIs fast within ASP.NET Core, compared to the controller-based APIs. Developers can build fully functioning REST endpoints with minimal code and configuration, especially without controller, action and even the formatters. See ASP.NET Core Minimal API details at here. Since Microsoft.AspNetCore.OData version 9.4.0, it enables developers to achieve OData functionalities on ASP.NET Core minimal APIs. In this post, I’d like to go through the basics of enabling OData functionalities on a Minimal API application. Let’s get started. Prerequisites...

OData .NET (ODL) 9 Preview Release
Aug 22, 2025
Post comments count 0
Post likes count 0

OData .NET (ODL) 9 Preview Release

John Gathogo
John Gathogo

We’re happy to announce that OData .NET (ODL) 9 Preview 2 has been officially released and is available on NuGet: What’s New in OData .NET (ODL) 9 Preview 1 & 2 The OData .NET (ODL) 9.0 previews introduce a set of important changes and cleanup efforts to modernize the library, align with .NET’s evolving runtime, and simplify the OData developer experience. Below, we’ll go through the notable changes included in the first two preview releases. Targeting .NET 10 Preview ODL now builds against .NET 10 preview, ensuring compatibility with the upcoming runtime. This helps early adopte...

ASP.NET Core OData Web API Template Preview Release
Apr 28, 2025
Post comments count 0
Post likes count 4

ASP.NET Core OData Web API Template Preview Release

Samuel Wanjohi
Samuel Wanjohi

We are excited to announce the public preview release of the ASP.NET Core OData Web API Template Pack. This template helps you create an ASP.NET Core Web API project with OData support, providing a streamlined setup for .NET 8.0 and above. The following preview release is now available on NuGet: Key Features Installation To install the template, use the following command: Usage Using dotnet CLI Create a new project using the template: Using Visual Studio IDE Select Create to create the new project...

Announcing ASP.NET Core OData 9 Official Release
Aug 30, 2024
Post comments count 2
Post likes count 11

Announcing ASP.NET Core OData 9 Official Release

John Gathogo
John Gathogo

We're happy to announce that ASP.NET Core OData 9 has been officially released and is available on NuGet: The major highlight of this release is the update of the OData .NET dependencies to the 8.x major version. By updating the dependencies, we're able to take advantage of the improvements and new capabilities introduced in Microsoft.OData.Core 8.x and Microsoft.OData.Edm 8.x releases specifically. The ASP.NET Core OData 9 release will only support .NET 8 or later. The OData .NET 8 official release announcement addresses the major changes introduced in that release. It's advisable to go through t...

Announcing OData .NET 8 Official Release
Aug 12, 2024
Post comments count 2
Post likes count 1

Announcing OData .NET 8 Official Release

Clément Habinshuti
Clément Habinshuti

We're happy to announce that OData .NET 8 has been officially released and is available on NuGet: We would like to thank the community for trying out the pre-release versions and sharing feedback with us following our announcements of the previews and release candidates. This release presents an opportunity for us to modernize our stack, address some technical debt and take better advantage of investments in .NET. OData .NET 8.0.0 contains changes to improve maintainability, user experience, performance and add new capabilities.​To make adoption and upgrading to the new version smooth, we hav...

Announcing OData .NET 8 Release Candidate 1
Jul 12, 2024
Post comments count 1
Post likes count 0

Announcing OData .NET 8 Release Candidate 1

Elizabeth Okerio
Elizabeth Okerio

OData .NET 8.0 RC1 is now available, bringing numerous significant improvements to the following libraries: This is the final release candidate before the official launch of these libraries, scheduled for August 12th. Most of the planned features and changes are included in this release candidate and are ready for you to explore. In addition to the changes listed in these documents: This release includes the following updates: Some of these updates are breaking changes. Updates in Version 8.0.0-rc.1   We invite you ...

Microsoft.AspNetCore.OData 9 Preview Release
Jun 12, 2024
Post comments count 0
Post likes count 0

Microsoft.AspNetCore.OData 9 Preview Release

Elizabeth Okerio
Elizabeth Okerio

We are excited to announce the forthcoming major release of Microsoft.AspNetCore.OData, scheduled for June. In preparation for this significant update, we have made preview versions of the library available to gather early feedback from our community. The following preview release is now available on NuGet: Key Update The primary change in this release is the update of the OData core libraries dependencies to the recently released OData Core 8.0.0-preview versions. To review the breaking changes and updates made in the OData Core libraries, which we have incorporated into this release, please check t...

OData .NET 8 Preview Release
Apr 26, 2024
Post comments count 13
Post likes count 5

OData .NET 8 Preview Release

Clément Habinshuti
Clément Habinshuti

We would like to announce that we are planning a new major release of OData .NET core libraries in June. Ahead of this release, we have released preview versions of the libraries to get some early feedback from the community. Specifically, the following preview releases are now available on NuGet: It has been almost 8 years since the last major release of OData .NET core libraries. This release presents an opportunity for us to modernize our stack, address some technical debt and take better advantage of investments in .NET. To make adoption and upgrading to the new version smooth, we have op...

Deep insert support in OData client
Sep 22, 2023
Post comments count 0
Post likes count 1

Deep insert support in OData client

Kennedy Kangethe Munga
Kennedy Kangethe Munga

In the Deep insert support in OData webapi blog post, we demonstrated how to add deep insert capabilities to an OData service. In this blog post, we demonstrate how to add deep insert capabilities in OData client. In the following sections, we implement a client app. Create a Console application Install required packages In our client application, we are going to use the library that offers APIs for building deep insert requests and consuming deep insert responses. Run the following command on the Visual Studio Package Manager Console to install the  nuget package...

Working with media resources in OData – Part 2
Aug 8, 2023
Post comments count 0
Post likes count 0

Working with media resources in OData – Part 2

John Gathogo
John Gathogo

In Part 1 of this blog post, we demonstrated how to implement an OData service that serves media resources. In Part 2, we look at how to implement a client app that interacts with the OData binary large object (BLOB) feed to both retrieve and post binary data along with the metadata for the media resource. The OData BLOB feed created in Part 1 supported the following functionality: The service also exposed a single media link entry (MLE) named that is linked to a media resource (MR). In the following sections, we implement a client app to interact with that BLOB feed. Create a Con...

Working with media resources in OData – Part 1
Aug 8, 2023
Post comments count 0
Post likes count 0

Working with media resources in OData – Part 1

John Gathogo
John Gathogo

OData enables you to define data feeds that serve binary large object (BLOB) data. In OData lingo, this binary data is referred to as a media resource. A media resource (MR) is an unstructured piece of data or stream, e.g., a document, image, or video. It is requested from the data service separately from the entry in the feed to which it belongs, called a media link entry. A media link entry (MLE) is a special type of entry which links to an MR and includes additional metadata about it. Typical metadata that an MLE may maintain about the related MR include description, file name, file size, dimensions, date uplo...

Enable Un-typed within ASP.NET Core OData
Jun 19, 2023
Post comments count 0
Post likes count 1

Enable Un-typed within ASP.NET Core OData

Sam Xu
Sam Xu

Introduction The latest ASP.NET Core OData supports the following two built-in OData abstract types: Developers can use them to advertise a property in OData metadata schema (aka, Edm model) so that such property is declared with a particular name present, but there is no type associated to describe the structure of the property's values. Here's an example: Where, Data is called single value untyped property, meanwhile Infos is called collection value untyped property. Since they are untyped, in other words, there's no type limitation for the property value, developers can use any kind of val...

Deep insert support in OData Web API
Jun 9, 2023
Post comments count 0
Post likes count 0

Deep insert support in OData Web API

Kennedy Kangethe Munga
Kennedy Kangethe Munga

Background In , we added support for deep insert. In deep insert, we create an object and its related items or link existing items in a single request. This blog post is a continuation of Bulk Operations Support in OData Web API. In that blog post, we explained how to use and classes. We will not repeat that in this blog post. Bulk update and deep insert share the same and classes. In the following sections, we will cover how deep insert is implemented in and the things that the developer needs to do to use it in their OData service. Controller For the controller action to handle deep insert, the...

Enable CBOR within ASP.NET Core OData
Mar 14, 2023
Post comments count 0
Post likes count 1

Enable CBOR within ASP.NET Core OData

Sam Xu
Sam Xu

Introduction CBOR, which stands for Concise Binary Object Representation, is a data format whose design goals include the possibility of extremely small code size, small message size, and extensibility without the need for version negotiation (from cbor.io). CBOR is based on the wildly successful JSON (aka, JavaScript Object Notation) data model, and is a binary data representation of JSON. Here's an example of a simple JSON value in plain text and binary representation. OData library, by default, uses the plain text JSON representation for OData requests and response data serialization (writing) and dese...

Customize OData payload serialization format within ASP.NET Core OData
Mar 9, 2023
Post comments count 7
Post likes count 2

Customize OData payload serialization format within ASP.NET Core OData

Sam Xu
Sam Xu

Introduction JSON (aka, JavaScript Object Notation), a standard text-based format for representing structured data based on JavaScript object syntax, is the default representation for the OData requests and responses payload, see OData JSON format here. It’s a very popular format and widely used in most scenarios. However, there are customers who want to build services following OData conventions and want to get OData payload using formats other than JSON, such as CSV (aka, Comma Separated Value) format, or YAML (aka, YAML Ain't Markup Language) format, etc. OData .NET libraries are designed to empower custom...

Bulk Operations Support in OData Web API
Dec 28, 2022
Post comments count 1
Post likes count 4

Bulk Operations Support in OData Web API

Elizabeth Okerio
Elizabeth Okerio

Good news! OData Web API 7.x now supports bulk operations. Install the most recent version of OData Web API 7.x(v7.6.3) to take advantage of bulk operations. A bulk operation is one that allows you to perform multiple operations (insert, update, delete) on multiple resources (of the same type) and their nested resources (to any level) with a single request. A bulk operation can either be:   Deep Update A deep update is a patch request. The following is an example of a deep update request: How the above request will be processed: NOTE: The @odata.context annot...

Extension: Omit null value properties in ASP.NET Core OData
Sep 7, 2022
Post comments count 0
Post likes count 4

Extension: Omit null value properties in ASP.NET Core OData

Sam Xu
Sam Xu

Introduction By default, ASP.NET Core OData serializes a single value property as “null”, and a collection value property as an empty array if its value is null as such: It’s good for most scenarios. However, omitting those 'annoying' null-value properties from the OData response gets more and more attention. Along with the latest ASP.NET Core OData, it’s very easy to omit such null-value properties by extending the OData resource serializer. The approach is so common that it’s better to create a post and value more customers/developers. Let’s get started. Prerequisites As usual, my post starts with buildin...

Using the new JSON writer in OData
Aug 17, 2022
Post comments count 0
Post likes count 3

Using the new JSON writer in OData

Clément Habinshuti
Clément Habinshuti

version 7.12.2 has introduced a new JSON writer that’s based on .NET’s Utf8JsonWriter. The current JSON writer used in , internally called , is a custom implementation that uses to write the JSON output to the destination stream. We decided to write a new implementation to take advantage of the performance optimizations in . In order not to disrupt existing customers, people will have to explicitly “opt-in” to using the new writer. Currently, allows you to override the default used for writing JSON output by providing a custom to the dependency-injection container that’s attached to the message instance (...

Tutorial: Build gRPC & OData in ASP.NET Core
Apr 20, 2022
Post comments count 2
Post likes count 0

Tutorial: Build gRPC & OData in ASP.NET Core

Sam Xu
Sam Xu

Introduction gRPC (google Remote Procedure Call) is a high-performance remote procedure call framework that helps developers to build and consume remote services using the same way as calling local APIs. Different from gRPC, OData (Open Data Protocol) is an OASIS standard that defines a set of best practices for developers to build and consume RESTful APIs using HTTP request/response. Both approaches have their own strong points, for example, gRPC has less network usage with protobuf binary serialization, on the contrary, OData uses JSON as data format for human readability. In addition, OData has powerful query...

Customizing $filter for spatial data in ASP.NET Core OData 8
Feb 22, 2022
Post comments count 0
Post likes count 0

Customizing $filter for spatial data in ASP.NET Core OData 8

Kennedy Kangethe Munga
Kennedy Kangethe Munga

Background The OData URI parser parses the $filter query to a FilterClause. The translates an OData parse tree represented by a FilterClause to an Expression. The can be applied to an and passed to an ORM (e.g Entity Framework Core) for processing. The contains the default implementation on how the Expressions should be created. This creates a few issues: In this blog post, we will demonstrate how to implement support for the OData spatial built-in function. The current ASP.NET Core OData 8 doesn't support it. EF Core enables mapping to spatial data types in the database by using typ...

$compute and $search in ASP.NET Core OData 8
Jan 11, 2022
Post comments count 10
Post likes count 0

$compute and $search in ASP.NET Core OData 8

Sam Xu
Sam Xu

Introduction OData system query options, such as $filter, $orderby, are a set of query string parameters that control the amount and order of the data returned for the resource identified by the URL. In the latest version of ASP.NET Core OData, two new system query options as follows are enabled: Along with other query options, $compute or $search requests the service to perform a set of transformations at the server side to control the returned data. In this post, I will use a simple product-sale OData service to go through the $compute and $search scenarios and share ideas of how to use $compute a...

The Future of OData NxT (Neo)
Jan 4, 2022
Post comments count 6
Post likes count 1

The Future of OData NxT (Neo)

Hassan Habib
Hassan Habib

Few months ago I announced a collaboration with the OData team to start building a new version of OData that can withstand the forever changing requirements in software design and architecture. I got together with Sam Xu and we decided to kick-off a spin-off version of OData.NET that I called OData NxT (Neo) OData Neo is an attempt to reconceptualize the core capabilities of OData while maintaining the original syntax protocols published by Microsoft back in 2007. The new Implementation will fulfill the following priorities: This is OData Neo. The next generation of OData Protocol implementation for the .NET ...

Adding support for $count segment in $filter collections in OData WebAPI
Aug 26, 2021
Post comments count 1
Post likes count 0

Adding support for $count segment in $filter collections in OData WebAPI

Kennedy Kangethe Munga
Kennedy Kangethe Munga

Introduction In OData core  v7.9.0 we added improved support for $count segment in $filter collection properties. Previously, versions of OData core had support for: We are constantly improving filtering capabilities in OData WebAPI. In OData WebApi v7.5.9 and OData WebApi v8.0.2, we have added support for the queries below According to the spec only or query options can be applied to a segment. Note: For scalar primitive collections, only is applicable. For scalar complex collection, both and are supported. Prerequisites Let us create an ASP.NET Core Application using Visual Studio 201...

Support for fetching nested paths in OData Web API
Aug 26, 2021
Post comments count 0
Post likes count 0

Support for fetching nested paths in OData Web API

Clément Habinshuti
Clément Habinshuti

Background OData services use nested paths to access properties or entities related to a resource. For example, if you want to access orders of a given customer, you would use a request path like: 7.x provides two main approaches for handling such requests: convention and attribute routing. In the first approach, we create controller actions with conventional naming patterns to handle specific scenarios. For example, if you want to handle fetching the customers entity set (), you would implement a method in the that returns the collection corresponding to the entity set as follows: To retrieve...

Build formatter extensions in ASP.NET Core OData 8 and hooks in ODataConnectedService
Aug 23, 2021
Post comments count 3
Post likes count 1

Build formatter extensions in ASP.NET Core OData 8 and hooks in ODataConnectedService

Sam Xu
Sam Xu

Introduction In this post, I will create formatter extensions in an OData web service and request/response hooks in an OData client application to generate/consume ETag control information. ETag (aka entity tag), one of OData control information that may be applied to an entity or collection in response, can be used in a subsequent request to avoid overwriting if the entity or collection's value has been changed by other requests. ETag value normally can be generated using concurrency properties automatically in OData, however, I’d like to use this post to share with you the ideas of how to extend serializati...

Tutorial: Creating a Service with ASP.NET Core OData 8.0 for .NET 5
Jul 30, 2021
Post comments count 4
Post likes count 1

Tutorial: Creating a Service with ASP.NET Core OData 8.0 for .NET 5

Lisi Case
Lisi Case

In this document, we will walk through the process of creating a local service using OData 8.0, which is optimized to support ASP.NET Core 5. To learn more about the changes, check out ASP.NET Core OData 8.0 Preview for .NET 5 (which also references ASP.NET Core OData now Available), written by my colleague, Sam. You'll notice that this post has a lot of similarities; here, I'm aiming to consolidate our documentation and share my experience from the perspective of an intern new to OData. Topics Covered Software Used As always, ...

Up & Running w/ OData in ASP.NET 6
Jul 10, 2021
Post comments count 9
Post likes count 2

Up & Running w/ OData in ASP.NET 6

Hassan Habib
Hassan Habib

In this article, I'm going to walk you through the simplest way you can follow to get up and running with OData 8.0 on ASP.NET 6.0 - including source code examples, video walk-throughs and a glimpse into the future of OData.

API versioning extension with ASP.NET Core OData 8
Jul 9, 2021
Post comments count 15
Post likes count 0

API versioning extension with ASP.NET Core OData 8

Sam Xu
Sam Xu

Introduction API versioning can help evolving our APIs without changing or breaking the existing API services. URL segment, request header, and query string are three ways to achieve API versioning in ASP.NET Core application. ASP.NET Core OData 8, built upon ASP.NET Core, has the built-in API versioning functionality via route URL prefix template. For instance, the following code configures a version template in the route URL prefix to achieve URL based API versioning: Based on this configuration, it supports API versioning using URL segment as: ASP.NET Core OData 8 doesn't have the built-in ...

Attribute Routing in ASP.NET Core OData 8.0 RC
Apr 7, 2021
Post comments count 11
Post likes count 0

Attribute Routing in ASP.NET Core OData 8.0 RC

Sam Xu
Sam Xu

Introduction Attribute routing is how Web API matches the incoming HTTP requests to an action based on route template attributes decorated on controller or action. ASP.NET Core defines a set of route template attributes to enable attribute routing, such as RouteAttribute, HttpGetAttribute etc. ASP.NET Core OData 8.0 RC supports these attributes to enable you to define OData attribute routing endpoints. In this post, I would like to share details about the changes and usages of the attribute routing in OData ASP.NET Core OData 8.0 RC. The code snippets in this post are from this sample project. Please try and...

OData Connected Service 0.12.0 Release
Feb 25, 2021
Post comments count 1
Post likes count 0

OData Connected Service 0.12.0 Release

Clément Habinshuti
Clément Habinshuti

OData Connected Service 0.12.0 has been released on the Visual Studio Marketplace. This release includes the following changes:   Restored default settings Some default options were inadvertently changed in a previous update, leading to default options that do not make sense for the majority of use cases. We have restored the affected default values to more reasonable options: Visit this page to learn more about available settings and their impact on the code generation process. Support for reference models with relative URIs In previous version, you would get an...

Passing OData Query Options in the Request Body
Dec 4, 2020
Post comments count 12
Post likes count 1

Passing OData Query Options in the Request Body

John Gathogo
John Gathogo

The query options part of an OData URL can be quite long, potentially exceeding the maximum length of URLs supported by components involved in transmitting or processing the request. HTTP does not impose any limits on the length of a URL, however, many hosting environments (including IIS) impose limitations which may restrict the client's ability to request the exact set of data that they are interested in. These limitations would especially pose a big challenge for clients using explicit select statements for example. Background One way that you can go round these limitations is by wrapping the GET request in ...

Introducing the OData Web API Authorization library
Nov 16, 2020
Post comments count 1
Post likes count 0

Introducing the OData Web API Authorization library

Clément Habinshuti
Clément Habinshuti

This post introduces the Web API Authorization library which automatically enforces the permissions defined in your OData model on your Web API endpoints.