Building Your First API with ASP.NET Core

Microsoft is moving towards a new direction with its developer frameworks, signified by the cross-platform, modular, and faster ASP.NET Core 1.x/2.0 and Entity Framework Core 1.x/2.0. In this course, you'll learn how to build an API with these.
Course info
Rating
(667)
Level
Beginner
Updated
Sep 11, 2017
Duration
4h 21m
Table of contents
Course Overview
Getting Acquainted with ASP.NET Core
Creating the API and Returning Resources
Manipulating Resources
Working with Services and Dependency Injection
Getting Acquainted with Entity Framework Core
Using Entity Framework Core in Our Controllers
Description
Course info
Rating
(667)
Level
Beginner
Updated
Sep 11, 2017
Duration
4h 21m
Description

Hello! My name is Kevin Dockx, and welcome to Building a RESTful API with ASP.NET Core. In this course, you will learn how to build a RESTful API with ASP.NET Core, which is quite different from a regular web API. You will get there by learning about major topics like how you can correctly interact with your API by using the correct HTTP methods & status codes, method safety and idempotency, validation, common features like paging, sorting, filtering and data shaping, and supporting HATEOAS, versioning, caching and concurrency. By the end of this course, you will be able to build an API with level 3 maturity, which is the highest possible level for APIs. Before you begin, make sure you are already familiar with C# and know a thing or two about building APIs with ASP.NET Core. I hope you’ll join me, and I look forward to helping you on your learning journey here at Pluralsight.

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
Building an Async API with ASP.NET Core
Intermediate
2h 42m
14 Aug 2018
More courses by Kevin Dockx
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi, I'm Kevin. Welcome to this Pluralsight course, Building Your First API with ASP. NET Core. ASP. NET Core and Entity Framework Core signify the direction Microsoft is taking with their developer frameworks. Both have been built from the ground up. In this course, you'll learn how to build an API with ASP. NET Core that connects to a database via Entity Framework Core. We'll build an API for getting information and manipulating it concerning cities and their points of interest. We'll start out with the basics. An introduction to ASP. NET Core, including how such a project is structured. Then we'll implement all the functionality you'd expect from an API, getting, creating, updating, and deleting resources. You'll learn about features and concepts that are essential to ASP. NET Core. We'll also dive into Entity Framework Core, the O/RM of choice for. NET Core applications. After this course, you'll have a good understanding of how to build an API from scratch with ASP. NET Core. Let's dive in.

Creating the API and Returning Resources
Hi there, and welcome to the Creating an API and Returning Resources module from the Building Your First API with ASP. NET Core course at Pluralsight. I'm Kevin, and I'll guide you through this module. We ended up with a bare bones web project in the previous module. Now it's time to start building our API. We learned that we can add various types of middleware. One of this is the ASP. NET Core MVC middleware, which we'll need to build our API. Once we've got that up and running, we'll learn how to return data or (to use the more correct terminology) resources from our API and how to interact with that API by sending HTTP requests. We'll also learn how we can configure the form of the response that's sent back to the consumer of the API. That's quite a lot of content coming up in this module, so let's dive in.

Manipulating Resources
Hi there, and welcome to the Manipulating Resources module from the Building Your First API with ASP. NET Core course at Pluralsight. I'm Kevin, and I'll guide you through this module. After the previous module, we now know how to get resources from our API. In this module, we'll take it one step further. We'll look into resource manipulation. That means we'll learn about creating, updating, and deleting resources, all pretty common functionality for an API. And as for now, manipulating resources, that means we should also validate the input. Let's get started with the first demo, creating a resource.

Working with Services and Dependency Injection
Hi there, and welcome to the Working with Services and Dependency Injection module from the Building Your First API with ASP. NET Core course at Pluralsight. My name is Kevin, and I'll guide you through the rest of this module. We've built our API, but we're not done yet. All APIs require a certain amount of logging, and ASP. NET Core has a built-in logging service. But to use that logging service, we must inject it into the class that needs it. So, first of all, we'll learn about ASP. NET Core's built-in dependency injection system. And then we'll inject a logger to this. And we'll also learn how to log to a file. Next to built-in services like the logger, we can also create, register, and use custom services. And that's what we'll do next. We'll make sure that when a user deletes a point of interest, the administrator of the system is notified of this. We'll separate that functionality out in a custom mail service. And that also means we'll have to store the mail address to send that mail to somewhere. So that allows us to look into configuration files. Let's dive in.

Getting Acquainted with Entity Framework Core
Hi there, and welcome to the Getting Acquainted with Entity Framework Core module from the Building Your First API with ASP. NET Core course at Pluralsight. I'm Kevin, and I'll guide you through this module. Up until now, we've worked with an in-memory datastore. That's great for demoes, but it's not something you'd use in a real-life application. For those, a persistent datastore is required. In this module, we'll add a database to our project and use Entity Framework Core to access it. We'll start out by introducing EF Core and by adding it to our project. We'll also look into migrations, a way to migrate between different versions of our underlying datastore. We'll learn how we can safely store the information needed to connect to our database, and we'll check out how we can seed the database with data from code. Let's dive in by introducing Entity Framework Core.

Using Entity Framework Core in Our Controllers
Hi there and welcome to the Using Entity Framework Core in our Controllers module from the Building Your First API with ASP. NET Core course at Pluralsight. My name is Kevin and just like with the last five modules, I'll also guide you through this one. This is the last module. The one in which the pieces are tied together. We've got all our API actions and we introduced Entity Framework Core in the previous module. In this module we'll tie these together. We'll start by looking into the repository pattern, through which we'll access our database via Entity Framework Core, and then we'll replace the codes that uses our current in-memory data store with code that will talk to a persistence store to database. We'll also introduce something new, AutoMapper. As you remember, DTOs and entity classes serve different purposes and we need a way to map between these. That's where AutoMapper comes into play. After this module we'll have a fully functional API that connects to a database for our Entity Framework Core. Let's start by introducing the repository pattern.