public void OnGet() { //https://docs.microsoft.com/cs-cz/aspnet/core/data/ef-rp/sort-filter-page?view=aspnetcore-3.0 Grades = new List <GradeViewModel>(); if (SearchString?.Length > 0) { foreach (var grade in _gradebook.GetGrades(SearchString)) { Grades.Add(new GradeViewModel() { Id = grade.Id, Subject = grade.Subject.Name, Acronym = grade.Subject.Acronym, Value = grade.Value, Weight = grade.Weight }); } } else { foreach (var grade in _gradebook.GetAllGrades()) { Grades.Add(new GradeViewModel() { Id = grade.Id, Subject = grade.Subject.Name, Acronym = grade.Subject.Acronym, Value = grade.Value, Weight = grade.Weight }); } } }
public void OnGet() { foreach (var item in _gradebook.GetAllGrades()) { _certificate.AddGrade(item); } CertificateData = _certificate.GetCertificateTable(); }
public void OnGet() { Grades = new List <GradeViewModel>(); foreach (var grade in _gradebook.GetAllGrades()) { Grades.Add(new GradeViewModel() { Id = grade.Id, Subject = grade.Subject.Name, Acronym = grade.Subject.Acronym, Value = grade.Value, Weight = grade.Weight }); } }