Welcome to Xamarin Guy Show Blog

Keep updated for latest and Greatest Posts from Xamarin guy

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:

Leave a Reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.