
上QQ阅读APP看书,第一时间看更新
Testing it up
Let's try our Controller by running our app in Debug Mode; in order to test it, we need to manually type the following URL in the browser's address bar:
http://localhost:<port>/api/quiz/latest/3
If we did everything correctly, it will show something like this:

Note how the ViewCount property is not present in the JSON-serialized output; that's by design, since it has been flagged with the JsonIgnore attribute, meaning that we're explicitly opting it out.
Our first Controller is up and running. Do not underestimate it! Eventually, it will be in charge of all quiz-related operations within our web application.