From the course: Building Applications with Angular, ASP.NET Core, and Entity Framework Core
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Edit question route in ASP.NET
From the course: Building Applications with Angular, ASP.NET Core, and Entity Framework Core
Edit question route in ASP.NET
- [Instructor] In this video, we'll create an end point on our back end, which will allow us to edit the question. Let's begin by opening up our sample values controller. Then let's scroll down to the put function on line 34, and we'll copy that. Then let's paste it below our post function in our questions controller. Then let's modify the parameter we take in so that we get a question instead of a string. So I'll copy what we have as our parameter from our post function, and paste it as a second parameter in our put function. Next let's try this out with Postman. So I'll set a break point on line 36, and let's get the server started. Then inside our Postman, let's change the action from post to put. And before we try it, since our put takes an ID in the first parameter, so if we take a look at our function, we can see we need to get the ID of whatever question we'd like to edit or put the changes into, we need to add that with a slash and then the ID to the URL. Now let's try to hit…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.