public List <string> GetStudents() { var students = _repo.GetStudents(); List <string> retValue = new List <string>(); foreach (StudentsDTO s in students) { retValue.Add(s.Name); } return(retValue); }
public IActionResult Index() { var students = _repository.GetStudents(); var dataForView = new List <StudentViewModel>(); foreach (var st in students) { var vm = new StudentViewModel(); vm.IdStudent = st.IdStudent; vm.FirstName = st.FirstName; vm.LastName = st.LastName; vm.Address = st.Address; var grades = _repository.GetGrades(st.IdStudent); foreach (var g in grades) { if (g.SubjectType == "Group 1") { vm.EctsSum += 5; } else if (g.Subject == "Group 2") { vm.EctsSum += 3; } else if (g.SubjectType == "Group 3") { vm.EctsSum += 1; } vm.AverageGrade += g.GradeValue; } if (grades.Count() > 0) { vm.AverageGrade = vm.AverageGrade / grades.Count(); } dataForView.Add(vm); } return(View(dataForView)); }
public async Task OnGetAsync() { Students = await _studentsRepository.GetStudents(); }
public void LoadStudents() { _allStudents = new ObservableCollection <Data.Student>(_studentsRepository.GetStudents()); Students = _allStudents; }
public IActionResult GetAllStudents([FromServices] IStudentsRepository studentsRepository) { return(Ok(studentsRepository.GetStudents())); }
public async Task <ActionResult <List <Student> > > GetStudents() => await _studentsRepository.GetStudents();
public async Task <List <Student> > GetAllStudentsAsync() { return(await studentsRepository.GetStudents()); }
public IEnumerable <Student> GetAllStudents() { return(_repository.GetStudents()); }