public ActionResult Rename(RenameSolution command) { return Validating(command, () => { _service.Execute(command); return RedirectToAction("List"); }); }
public Solution renameSnapshot(RenameSolution command) { Solution old = _snapshots.Single<Solution>(s => s.Id == command.Id); old.Rename(command.NewName); _snapshots.Save(old); return old; }
public void Execute(RenameSolution command) { _validation.AssertValidity(command); try { Solution renamed = renameSnapshot(command); renameModel(renamed); renameAssignedModels(renamed); // another bounded context (DefectHandling) renameHandlingSnapshot(renamed); renameSupportEntities(renamed); renameHandlingAssignedModels(renamed); _models.SaveChanges(); } catch (Exception) { _snapshots.RollbackChanges(); throw; } }
public ActionResult Rename(Guid id) { Solution solution = _queries.GetSolution(id); var mapped = new RenameSolution(id, solution.Name); return View(mapped); }