// GET: StudentController/Create public async Task <ActionResult> Create() { var groups = await groupService.ActivesAsync(); var groupsView = groups.Select(g => mapper.Map <GroupViewModel>(g)); ViewBag.Groups = new SelectList(groups, "Id", "Name"); return(View()); }
// GET: GroupController public async Task <ActionResult> Index() { var groups = await groupService.ActivesAsync(); var groupsView = groups.Select(g => mapper.Map <GroupViewModel>(g)); return(View(groupsView)); }