private async Task InitializeViewModels() { if (ProfessorVM == null) { ProfessorVM = new ProfessorVM(); await ProfessorVM.LoadProfessors(); } }
public async Task <ActionResult> Editar(ProfessorVM professorVM) { try { var professorModel = Mapper.Map <ProfessorVM, Professor>(professorVM); await _bussinesProfessor.AlterarAsync(professorModel); TempData["Mensagem"] = "Professor Alterado com Sucesso."; return(RedirectToAction(nameof(Index))); } catch (ArgumentException ex) { TempData["Mensagem"] = ex.Message; return(View(professorVM)); } }
public OnRemoveCommand(ProfessorVM professor) { this.professor = professor; }
public OnEditCommand(ProfessorVM professor) { this.professor = professor; }
public OnDetailCommand(ProfessorVM professor) { this.professor = professor; }