public async Task <IActionResult> Create()
        {
            var professors = await _professorService.FindAllAsync();

            var viewModel = new LectureFormViewModel {
                Professors = professors
            };

            return(View(viewModel));
        }
        public async Task <IActionResult> Index()
        {
            var list = await _professorService.FindAllAsync();

            foreach (Professor prof in list)
            {
                var department = await _departmentService.FindByIdAsync(prof.DepartmentId);

                prof.Department = new Department(department.Id, department.Name);
            }
            return(View(list));
        }
        //GET
        public async Task <IActionResult> Create()
        {
            var professores = await _contextProfessor.FindAllAsync();

            var turmas = await _contextTurma.FindAllAsync();

            var viewModel = new AlunoViewModel {
                Professores = professores,
                Turmas      = turmas
            };

            return(View(viewModel));
        }
예제 #4
0
        public async Task <IActionResult> Index()
        {
            var lista = await _contextProfessor.FindAllAsync();

            return(View(lista));
        }
        public async Task <IActionResult> Index()
        {
            var list = await _ProfessorService.FindAllAsync(); //Puxar lista do professor

            return(View(list));
        }