public async Task <ActionResult> Index() { var professores = await _bussinesProfessor.ObterTodosAsync(); var professoresVM = Mapper.Map <IList <Professor>, IList <ProfessorVM> >(professores); return(View(professoresVM)); }
public async Task InicializarViewBagAsync() { var modulosViewModel = Mapper.Map <IList <Modulo>, IList <ModuloVM> >(await _bussinesModulo.ObterTodosAsync()); var professoresViewModel = Mapper.Map <IList <Professor>, IList <ProfessorVM> >(await _bussinesProfessor.ObterTodosAsync()); ViewBag.Modulos = modulosViewModel; ViewBag.Professores = professoresViewModel; }