// GET: Clientes
        public ActionResult Index()
        {
            var courseViewModel = Mapper.Map <IEnumerable <Course>, IEnumerable <CourseViewModel> >(_courseApp.GetAll());

            return(View(courseViewModel));
        }
Esempio n. 2
0
 // GET: Subjects/Create
 public ActionResult Create()
 {
     ViewBag.CourseId  = new SelectList(_courseApp.GetAll(), "Id", "Name");
     ViewBag.TeacherId = new SelectList(_teacherApp.GetAll(), "Id", "Name");
     return(View());
 }
Esempio n. 3
0
        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));
        }
Esempio n. 5
0
 public async Task <IActionResult> Index()
 {
     return(View(await _courseAppService.GetAll()));
 }