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

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…

Contents