From the course: Building Angular and ASP.NET Web API Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a Web API HttpPut endpoint

Creating a Web API HttpPut endpoint

From the course: Building Angular and ASP.NET Web API Apps

Start my 1-month free trial

Creating a Web API HttpPut endpoint

- [Instructor] On this part, we are going to start to implement the update feature of our application. And we are going to do so by first creating an Http Endpoint, which is going to handle this request. So let us go to our solution. To create this Http Endpoint, we need to go to our controller. So inside the controllers folder let us has go to the entries controllers file. In here, just scroll down to the bottom, and start implementing our new Endpoint. Since we are going to update some existing data, we're going to decorate this method or this Endpoint with an Http Put verb. So let us write in here Http Put. The next right public IHttpActionResult, and the name will be UpdateEntry. This Endpoint is going to take two parameters. The first parameter is going to be the id, and by using this id we are going to get the old entry from our database. And the new one is going to be the new entry, which are going to send us a part of our request body. So let us right in here that the object…

Contents