public List <SelectListItem> GetAllExamSlItems() { var exams = _batchManager.GetAllExams(); var slItems = new List <SelectListItem>(); foreach (var exam in exams) { var sli = new SelectListItem(); sli.Text = exam.Code + " - " + exam.Topic; sli.Value = exam.Id.ToString(); slItems.Add(sli); } return(slItems); }