public IActionResult Create(NoteCreateViewModel model) { if (!ModelState.IsValid) { model.NoteTypes = work.NoteTypeRepository.GetAll().Select(e => NoteTypeModel.GenerateNoteTypeModelFromDTO(e)); return(View(model)); } work.NoteRepository.Add(NoteModel.GenerateNoteDTOFromModel(model.Note)); work.Save(); return(RedirectToAction("Index", new { GameID = model.Note.GameID })); }