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

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Create the update API endpoint

Create the update API endpoint

- [Instructor] In this part, we're going to create the API endpoint that we're going to use to update a transaction in our Angular app. So what we basically need is that we need to create a new action and this action is going to handle HttpPut requests from our Angular app, is going to use an ID value to get the old record from the database, update the data, send the updated data back to the database, and then just send the response back to the Angular app. Once the Angular app has a response, we can either redirect the users to the list page or we can just keep them to the same page in case they want to change something else. Now, to better understand this, let's go to Visual Studio. In Visual Studio, because we are going to send some data other than the ID from the Angular app, let us create a new Dto. For that, in the Solution Explorer, I'll just go to the Dtos, then right click go to Add, add a Class and then just name it, PutTransactionDto, then click Add. I'll now go to the…

Contents