public ICommandResult Handle(ProfessorInputDelete command) { _PREP.Disable(command.ProfessorId); var result = new StandardResult(); if (_PREP.Get(command.ProfessorId).Active != false) { result.Notifications.Add("Error", "Não foi possivel deletar Docente!"); } else { result.Notifications.Add("Success", "Professor Deletado"); } return(result); }
public async Task Remove(int id) { var professor = await _professorRepository.FindById(id); await _professorRepository.Disable(professor); }