public ProfessorResultQueryGet Handle(ProfessorInputGet command) { var result = new ProfessorResultQueryGet(); result.Professor = _PREP.Get(command.ProfessorId); return(result); }
public IActionResult Remove(long id) { var isExistingProfessor = ProfessorRepository.Get(id); if (isExistingProfessor == null) { return(BadRequest("No such professor exists")); } //delete ProfessorRepository.Remove(isExistingProfessor); ProfessorRepository.SaveChanges(); return(Ok()); }
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 Professor Get(Guid id) { return(_professorRepository.Get(id)); }
public IEnumerable <GetProfessorsQuery> Get() { return(_repository.Get()); }