If a user enters the wrong values in a form, they should be able to update the data. For that reason, learn how to create an update API endpoint which can be used to update an existing entity in the database.
- [Instructor] So now we can add new trips … and we can read all of them. … But what if we enter some bad information … when we create new trips? … For that, we need to be able to modify the existing trips. … So we need to go to our controller … and create a new API Endpoint to update the data. … In here, go to the Controllers folder, … and then TripsController.cs file. … Just after the AddTrip, … we are going to create a new endpoint. … Now since we want to update the data, … we are going to send an HttpPut request … and we are going to name the url … or the API endpoint UpdateTrip. … Then, as part of the url, … we are going to have a parameter id. … So let's write down here, … public IActionResult UpdateTrip. … This will take two parameters, … the trip id, which is going to be part of the url, … so int id, … and from the request body … we want to send the data of the new trip, … so the updated values of the trip. … So let's write in here [FromBody]Trip, and then trip. … And then in here we are going to write _service.UpdateTrip …
- Setting up the app infrastructure
- Creating data models
- Creating, reading, updating, and deleting API endpoints
- Testing API endpoints using Postman
- Reading data from React
- Adding new data from React
- Handling errors
- Implementing Redux in an existing React app
- Implementing authentication in your React app
Skill Level Intermediate
Managing App Secrets in .NET Corewith Ervis Trupja28m 15s Intermediate
1. Setting Up the App Infrastructure
2. Setting Up Web API
3. Getting Started with React
4. Implementing Redux to an Existing React App
5. Implementing Authentication in Your React App
Where to go next44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.