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.

Add answers to a question in ASP.NET

Add answers to a question in ASP.NET

From the course: Building Applications with Angular, ASP.NET Core, and Entity Framework Core

Start my 1-month free trial

Add answers to a question in ASP.NET

- [Instructor] Let's begin by modifying our questions model. We'll add the properties in order to support answers. So below line 11, let's add a new property. It will be of type string called correct answer. I'll copy this and paste it three more times. Then I'll rename our first copy to answer one. Our second copy to answer two, and so on. Let's save that. Let's go ahead and start our server and once it loads, let's go to our front end. And then let's try posting. We can see we've got a status quo of 200 okay. Let's go ahead and place a break point on line 35 after save changes. Let's try posting again from our app. Now if we hover over questions on line 33, go over to Results View. We can see that we have two questions, but the values aren't being set. That's because our place holder is still being saved. So let's take that out from line 33 and replace it with the question we get from our front end. Let's try that again. So I'll start the server and then post our question once…

Contents