December 2019
Intermediate to advanced
598 pages
12h 21m
English
Recall that the home screen of our app, as implemented in Chapter 3, Getting Started with React and TypeScript, shows the unanswered questions.
So, let's implement an action method that provides this functionality:
[HttpGet("unanswered")]public IEnumerable<QuestionGetManyResponse> GetUnansweredQuestions(){ return _dataRepository.GetUnansweredQuestions();}
The implementation simply calls into the data repository GetUnansweredQuestions method and returns the results.
Notice that the HttpGet attribute contains the string "unanswered". This is an additional path to concatenate to the controller's root path. So, this action method will handle GET
Read now
Unlock full access