public IActionResult Index() { HomeViewModel homeViewModel = new HomeViewModel() { TotalTrainers = _trainerService.Count(), TotalStudents = _studentService.Count(), TotalLessons = _lessonService.Count(), YesterdayLessons = _lessonService.GetByDate(DateTime.UtcNow.AddDays(-1)).Data, TodayLessons = _lessonService.GetByDate(DateTime.UtcNow).Data }; return(View(homeViewModel)); }
public ActionResult Index() { ViewBag.StudentCount = studentService.Count(); ViewBag.TeacherCount = teacherService.Count(); ViewBag.LessonCount = lessonService.Count(); ViewBag.ParentCount = parentService.Count(); ViewBag.MostExpensiveLesson = lessonService.GetAll().OrderByDescending(x => x.ücret).FirstOrDefault().dersAdi; ViewBag.MostCheapLesson = lessonService.GetAll().OrderBy(x => x.ücret).FirstOrDefault().dersAdi; ViewBag.MostSelectionStudent = studentService.GetAll().OrderByDescending(x => x.dersSecimleri.Count).FirstOrDefault().ogrenciAdi; ViewBag.MostSelectionLesson = lessonService.GetAll().OrderByDescending(x => x.dersSecimleri.Count).FirstOrDefault().dersAdi; return(View()); }