public ActionResult EditTestF(EditTestAndQuestionsViewModel model) { if (!ModelState.IsValid) { return(RedirectToAction("ViewTests", "Admin")); } _testStore.UpdateTest(model.ToDataModel()); HelpingClass.FEach(model.Questions, x => _questionStore.UpdateQuestion(x)); return(RedirectToAction("ViewTests", "Admin")); }
public ActionResult DeleteConfirm(ModelUser model) { if (!ModelState.IsValid) { return(RedirectToAction("Delete", "Admin")); } List <ModelUserRole> UR = _userRoleStore.GetUserRolesByUser(model.Username).ToList(); HelpingClass.FEach(UR, x => _userRoleStore.DeleteUserRole(x)); _userStore.DeleteUser(model); return(RedirectToAction("Delete", "Admin"));; }