December 2019
Intermediate to advanced
598 pages
12h 21m
English
Let's move on to implementing the action method for getting a single question:
[HttpGet("{questionId}")]public ActionResult<QuestionGetSingleResponse> GetQuestion(int questionId){ // TODO - call the data repository to get the question // TODO - return HTTP status code 404 if the question isn't found // TODO - return question in response with status code 200}
Note the HttpGet attribute parameter.
In this method, the questionId parameter will be set to whatever comes after the controller root path. So, for ...
Read now
Unlock full access