// GET: Clientes public ActionResult Index() { var courseViewModel = Mapper.Map <IEnumerable <Course>, IEnumerable <CourseViewModel> >(_courseApp.GetAll()); return(View(courseViewModel)); }
// GET: Subjects/Create public ActionResult Create() { ViewBag.CourseId = new SelectList(_courseApp.GetAll(), "Id", "Name"); ViewBag.TeacherId = new SelectList(_teacherApp.GetAll(), "Id", "Name"); return(View()); }
private async Task <IActionResult> GetAll() { await _courseAppService.GetAll(); return(Ok()); }
// GET: Courses public ActionResult Index() { var courseViewModel = Mapper.Map <IEnumerable <Course>, IEnumerable <CourseViewModel> >(_courseApp.GetAll()); foreach (CourseViewModel item in courseViewModel) { item.CountStudents = _studentApp.CountStudentsByCourse(item.CourseId); item.CountTeachers = _teacherApp.CountTeachersByCourse(item.CourseId); item.CourseAverage = _courseSubjectsApp.AverageByCourse(item.CourseId); } return(View(courseViewModel)); }
public async Task <IActionResult> Index() { return(View(await _courseAppService.GetAll())); }