Adding other controllers
Now that we know the trick, we can add a bunch of other ViewMode and Controller pairs, one for each entry type we came up with earlier. In order to avoid repetition we'll skip the create file part and jump directly to the source code for each one of them, while also adding some useful hints where we need to.
QuestionViewModel
What will a quiz be without some questions? Here's how we can deal with the QuestionViewModel.cs
file that we need to add within the /ViewModels/
folder:
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Threading.Tasks; namespace TestMakerFreeWebApp.ViewModels { [JsonObject(MemberSerialization.OptOut)] public class QuestionViewModel { #region Constructor public QuestionViewModel() { } #endregion #region Properties public int Id { get; set; } public int QuizId { get; set...