private async Task <SelectList> CreateSemestersSelectList(int?currentId) { var tmpList = (await semestersRepository.GetSemestersAsync()).Select(s => new CustomSelectListItem() { Name = s.Name, Id = s.Id }).ToList(); tmpList.Insert(0, new CustomSelectListItem() { Name = "Без семестра", Id = null }); return(new SelectList(tmpList, "Id", "Name", currentId)); }
public async Task <IActionResult> Index() { return(View(await semestersRepository.GetSemestersAsync())); }