public async Task<ActionResult> Add(int? year = null) { if (year == null) await YearManager.AddAsync(); else await YearManager.AddAsync(year.Value); return RedirectToAction("Index"); }
public async Task<ActionResult> Index() { var viewModels = (await YearManager.GetAllAsync<Year>()) .Select(YearMapper.Map<Year, YearViewModel>) .OrderByDescending(x => x.Year).ToArray(); return View(viewModels); }