The next thing to do is to derive the QuizController, QuestionController, AnswerController, and ResultController from this BaseApiController class, so they can inherit the shared properties and get rid of a lot of duplicate code; let's start with the QuizController.
Open the QuizController.cs file and perform the following changes (updated lines are highlighted):
[...]namespace TestMakerFreeWebApp.Controllers{ public class QuizController : BaseApiController { #region Constructor public QuizController(ApplicationDbContext context) : base(context) { } #endregion[...]
As we can see, we removed the following:
- The [Route("api/[controller]")] attribute, since it's already present in the BaseApiController; all the ...