From the course: Building Web APIs with ASP.NET Core 8
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Controllers and actions
From the course: Building Web APIs with ASP.NET Core 8
Controllers and actions
- [Instructor] In this chapter, we will start implementing the API for HPlusSport with the probably easiest use case there is, retrieving data. Remember what we've done so far, we've created a project using the ASP.NET core Web API template. And in that wizard, or alternatively when using the .NET CLI with the parameters the CLI provides us with, we made sure that we use controllers. So I'd like to use controllers at first, and then later, we'll migrate over to minimal APIs. And I would also like to enable OpenAPI support so that we get that Swagger UI that allowed us to try out the API directly in the browser. The wording of the labels of those check boxes may differ a little bit depending on the version of Visual Studio and the version of the SDK, but basically that's what we set up. And then we had a controllers folder in our application, and we didn't have a specific look at it, but we are about to implement such a controller right now. Yet the controller that was created for us…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Controllers and actions7m 50s
-
(Locked)
Routing basics6m 14s
-
(Locked)
Creating a data model5m 54s
-
(Locked)
Using entity framework core7m 28s
-
(Locked)
Returning a list of items4m 4s
-
(Locked)
Using ActionResult2m 44s
-
(Locked)
Returning an item4m 29s
-
(Locked)
Handling errors3m 5s
-
(Locked)
Making the API asynchronous2m 51s
-
(Locked)
Working with minimal APIs5m 22s
-
(Locked)
Challenge: Searching items31s
-
(Locked)
Solution: Searching items3m 1s
-
(Locked)
-
-