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.

Post quiz to back end

Post quiz to back end

- [Narrator] This video will create the front-end and back-end API components to descend over our new quiz. Let's open up our API service. We'll start by copying the postQuestion from line 17 and then let's paste it below the last question function putQuestion on line 23 and we will rename it to postQuiz, and that will take in a quiz instead of a question. Then we'll change the URL, instead of questions, to quizzes since we'll assume we'll have a quizzes controller, and we'll pass in our quiz with that HTTP post as a second parameter. Next, let's go ahead and open up our back-end and stop the server. Then in our Solution Explorer, let's create a new quiz model. So, I'll simply copy and paste our questions model and let's rename it to quiz. And then we'll rename the class to quiz as well. Then I'll get rid of all the properties between line 12 and line 15 and change the Text property to Title, then I'll clean that up by removing the unused name spaces. Now that we have our quiz model…

Contents