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
From the course: Building Angular and ASP.NET Web API Apps
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
-
-
-
-
Create an empty Web API Project9m 4s
-
(Locked)
Define application models5m 47s
-
(Locked)
Configure entity framework for database access13m 55s
-
(Locked)
Build the Create API endpoint10m 41s
-
(Locked)
Create the read-all API endpoint3m 4s
-
(Locked)
Create the read by ID API endpoint6m 55s
-
(Locked)
Create the update API endpoint7m 4s
-
(Locked)
Create the delete API endpoint3m 10s
-
(Locked)
Cleanup Code16m 24s
-
-
-
-
-