Xamarin Forms Project Tutorial

Question and Answer API in Asp.net core Web Api[Sampurna] #4

This is a simple api where we are going to display list of answers with respect to the given question :
Step1:
Models Folder
Answer.cs:

Question.cs

ExamContext.cs

Step2:
Startup.cs

Step-3: Inside Packetmanager console
Add-migration initial
Update-database
Step4:
Now it’s time to create api controllers:
QuestionController.cs

AnswerController.cs

Step5: Fill the table with data at first then it’s time to get answers from the given parameters
Using get request : http://localhost:49795/api/Answer?question=mexican
Select Params
Key: question
value : mexican
now out put:

206 total views, 1 views today

Leave a Reply