Exemplo n.º 1
0
        public ActionResult Details(int id)
        {
            ProfessorServiceRemote.ProfessorServiceClient cliente = new ProfessorServiceRemote.ProfessorServiceClient();
            CursoServiceRemoto.CursoServiceClient clienteCurso = new CursoServiceRemoto.CursoServiceClient();

            Professor professor = Mapper.Map<ProfessorDTO, Professor>(cliente.Find(id));

            if (professor == null)
            {
                return HttpNotFound();
            }

            professor.Cursos = Mapper.Map<List<Curso>>(clienteCurso.GetAllByProfessor(id));

            return View("Details", professor);
        }
Exemplo n.º 2
0
        public ActionResult Details(int id)
        {
            ProfessorServiceRemote.ProfessorServiceClient cliente      = new ProfessorServiceRemote.ProfessorServiceClient();
            CursoServiceRemoto.CursoServiceClient         clienteCurso = new CursoServiceRemoto.CursoServiceClient();

            Professor professor = Mapper.Map <ProfessorDTO, Professor>(cliente.Find(id));

            if (professor == null)
            {
                return(HttpNotFound());
            }

            professor.Cursos = Mapper.Map <List <Curso> >(clienteCurso.GetAllByProfessor(id));

            return(View("Details", professor));
        }