Exemplo n.º 1
0
        public ProfessorResultQueryGet Handle(ProfessorInputGet command)
        {
            var result = new ProfessorResultQueryGet();

            result.Professor = _PREP.Get(command.ProfessorId);

            return(result);
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public Professor Get(Guid id)
 {
     return(_professorRepository.Get(id));
 }
 public IEnumerable <GetProfessorsQuery> Get()
 {
     return(_repository.Get());
 }