Building a Consistent RESTful API with OData V4 in ASP.NET

OData V4, an open OASIS standard dubbed "The Best Way to REST," aims to standardize the process of building RESTful APIs. Discover OData and how to build and consume a RESTful API that adheres to the OData V4 standard, using ASP.NET (Web API).
Course info
Rating
(87)
Level
Beginner
Updated
May 11, 2016
Duration
4h 29m
Table of contents
Course Overview
Introduction to REST and OData V4
Creating and Consuming an OData V4 Service
Querying Data
Working with Containment, Custom Functions, Actions, and Singletons
Working with Derived Types, Open Types, and Batch Processing
Building Client Applications that Consume OData V4 Services
Description
Course info
Rating
(87)
Level
Beginner
Updated
May 11, 2016
Duration
4h 29m
Description

When building RESTful APIs, many people run into the same types of questions: "How should I name my resources? How should I work with relations? Can I call functions? Hasn't anyone thought of a way to standardize all this?" Well, someone has, and in this course, Building a Consistent RESTful API with OData V4 in ASP.NET, you'll be shown how OData V4, an open OASIS standard, aims to provide a way to build a consistent, predictable RESTful API. This demo-driven course teaches you how to build and consume a RESTful API that adheres to the OData V4 standard, using ASP.NET (Web API). You'll learn how to work with Entities and EntitySets, how to query data (from field-level selection over paging to filtering), how to work with custom actions and functions, inheritance, open types and much more - right up to how to build client applications that consume OData services. By the end of this course, you'll not only know how to use OData V4, but you'll also have a consistent process that helps you to create RESTful APIs more efficiently than ever.

About the author
About the author

Kevin Dockx is a freelance solution architect (mobile/web), author & consultant, living in Antwerp (Belgium).

More from the author
Using HttpClient to Consume APIs in .NET Core
Intermediate
3h 20m
Jan 11, 2019
More courses by Kevin Dockx
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi, I'm Kevin. Welcome to my Pluralsight course on OData v4, more specifically on how to build a consistent RESTful API in ASP. NET that _____studio OData for a standard, because that's essentially what OData v4 is. It's a standard that describes best practices for building and consuming RESTful API. In this course, you'll learn what it's all about with tons of demos. We'll start out with the basics, getting entity sets or entities to the consumer. You'll also learn how to create, update, and delete these. One of the features OData offers is its ability to query data, much like you would write queries against a database. We'll learn this is immensely powerful by looking into selecting specific properties, expanding result sets, filtering data, and more. We'll also cover the ability to contain an entity or entity set inside another set, the ability to create custom functions and actions to extend server-side behavior, and we'll learn how to work with singletons. OData also supports querying only derived types, working with open types, and batch processing. Lastly, as OData is a standard, integration with OData services can be highly automated. That's what we'll look into when we start building clients, both in JavaScript and. NET, to consume our OData service. After this course, you'll have a good understanding of how to consume OData v4 services with ASP. NET. Let's dive in.

Introduction to REST and OData V4
Hi there, and welcome to this course on building a consistent RESTful API with OData V4 in ASP. NET at Pluralsight. My name is Kevin, and I'll guide you through the rest of this course. This is a beginner course in OData. In this and the upcoming modules, you'll learn what OData is, why it's useful, and how to build OData services in ASP. NET. We'll cover a variety of topics and concepts, CRUD operations, working with queries, functions, actions, and much more, right up to batch processing and building client applications that consume OData services. We'll build and learn more topic by topic. The course is very demo-driven. Most of what we'll learn, we'll learn using demos rather than going through slide after slide, so I hope you like seeing code, as we're going to learn the OData standard by example. At the end of this course, you'll know how to build OData services by implementing the OData standard, and you'll know how to consume them, both manually and from code. Let's have a look at the course prerequisites.

Creating and Consuming an OData V4 Service
Hi, and welcome to the Creating and Consuming an OData V4 Service module of the Building a Consistent RESTful API with OData V4 in ASP. NET course at Pluralsight. My name is Kevin, and I'll guide you through the rest of this module. In this module, we'll build our first OData service, but before we can do that we must learn what the Entity Data Model and Conceptual Model are. After that, we can create our first OData service, which will allow us to select entities, sets of entities, and individual properties. But how can we make sure a certain URI maps to a certain method? That's where routing comes in. A lot of services you'll want to write will require you to manipulate entities, create them, update them or delete them, and that's not all, entities might be related to other entities or sets of entities. We'll cover those topics as well. Let's dive in.

Querying Data
Hi there, and welcome to the Querying Data module of the Building Consistent RESTful API with OData 4 in ASP. NET course at Pluralsight. My name is Kevin, and I'll guide you through the rest of this module. One of the selling points of OData is its built-in ability to query resources, almost like writing queries against a database. We'll look into selecting specific properties from a resource, and including related resources in the same result set. We'll learn how to order resources, page through them, and a pretty big part of this module, what options we have when it comes to filtering them. All this is done through what are called system query options, so in this module we'll learn how to do that by looking into the most important query options.

Working with Containment, Custom Functions, Actions, and Singletons
Hi, and welcome to the Working with Containment, Custom Functions, Actions, and Singletons module from the Building a Consistent RESTful API with OData V4 course at Pluralsight. My name is Kevin, and I'll guide you through the rest of the module. We'll dive into some more advanced, yet still often-used parts of the OData standard. We'll start out with containment, or containment navigation, the principle that allows us to avoid top-level access for navigation properties that shouldn't exist on their own. After that, we'll look into custom functions and actions which allow us to add server-side behavior that is not easily defined as a simple CRUD operation. We'll end the module by creating a singleton. This allows addressing a single entity directly from the entity container without having to know its key and without requiring an entity set. Let's start with containment navigation.

Working with Derived Types, Open Types, and Batch Processing
Hi there, and welcome to the Working with Derived Types, Open Types, and Batch Processing module of the Building a Consistent RESTful API with OData V4 in ASP. NET course at Pluralsight. My name is Kevin and I'll guide you through the rest of this module. We start this module by learning how we can ensure that only entities of a specific derived types are returned in a result set. By working with open types, we learn how we can add undeclared properties and property values dynamically, and we end the module with checking out Batch requests, which allow us to group different requests together in one transaction. After this module, the OData API is fully built.