public ActionResult Index() { // We only want a list of months in a single array. var model = new MonthViewModel { MonthData = _repository .GetAll() .Select(item => item.MonthName).ToArray() }; return(View(model)); }
private async Task RefreshCollectionsAsync() { ViewData["ReadUserId"] = new SelectList(await _systemUserRepository.GetAll(), "Id", "FullName"); ViewData["MonthId"] = new SelectList(await _monthRepository.GetAll(), "Id", "ShortDesc"); }
public async Task <IActionResult> Index() { ViewData["MonthCollection"] = new SelectList(await _monthRepository.GetAll(), "Nemotecnico", "ShortDesc"); return(View()); }
private async Task RefreshCollections() { var data = await _monthRepository.GetAll(); ViewData["MonthCollection"] = new SelectList(data, "Nemotecnico", "ShortDesc"); }