public async Task <IActionResult> Students() { ViewBag.Title = "Admin - Students"; var vm = new StudentViewModel(); var classes = await _classBll.GetAllClass(); var students = await _studentBLL.GetAllStudentsAsync(); vm.ListOfClasses = classes.Select(c => c.Name); vm.Students = students.ToList(); return(View(vm)); }
public async Task <ActionResult <IEnumerable <Student> > > GetAllStudents() { return(new JsonResult(await _studentBll.GetAllStudentsAsync())); }