Handling requests using controllers and actions

The purpose of action methods is to handle and respond to incoming requests. The example described in this section will show you how to deal with HTTP requests using controllers. We will apply some of the concepts we have looked at in previous chapters, such as dependency injection. The following example will use the same project structure we created in Setting up an ASP.NET Core project section of Chapter 2, Overview of ASP.NET Core.

The source code for this section is available on GitHub at https://github.com/PacktPublishing/Hands-On-RESTful-Web-Services-with-ASP.NET-Core-3.

The next subsection introduces a plain in-memory repository that will be used to store some data and retrieve it through our controller stack. The purpose of this type of repository is to set up a quick storage system without introducing any additional application complexity.  

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.193.172