December 2019
Intermediate to advanced
598 pages
12h 21m
English
Our QuestionPostRequest model is used both in the data repository to pass the data to the stored procedure as well as in the API controller to capture the information in the request body. This single model can't properly cater to both these cases, so we are going to create and use separate models:
public class QuestionPostFullRequest{ public string Title { get; set; } public string Content { get; set; } public string UserId { get; set; } public string UserName { get; set; } public DateTime Created { get; set; }}
This contains all the properties that are needed by the data repository to save a question. ...
Read now
Unlock full access