CHAPTER 12

image

OData

In this chapter, I will briefly introduce ASP.NET Web API support for OData, the Open Data Protocol. You will learn how to do the following:

  • Create a simple OData service in ASP.NET Web API (Recipe 12-1)
  • Create centralized and attribute-based OData routes (Recipe 12-2)
  • Work with OData Query Options (Recipe 12-3)
  • Support OData functions and actions in ASP.NET Web API (Recipe 12-4)

12-1. Creating OData Services in Web API

Problem

You would like to create an OData service using ASP.NET Web API.

Solution

The easiest way to get started with OData in Web API is to use the ASP.NET scaffolder to generate OData controllers for you. To ...

Get ASP.NET Web API 2 Recipes: A Problem Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.