public virtual async Task<ActionResult> Index(ThingyModel model) { if (ModelState.IsValid) { await SaveThingyCommand.ExecuteAsync(model); return RedirectToAction(MVC.Home.Index()); } return View(model); }
public virtual async Task<ActionResult> Index(Guid? id) { var model = new ThingyModel(); if (id != null && id != Guid.Empty) { var res = GetThingyQuery.ExecuteCached(id.Value) ?? await GetThingyQuery.ExecuteAsync(id.Value); if (res != null) { model = DtoToModelMapper.Map(res, new ThingyModel()); } } return View(model); }