public ActionResult Create(CreateSolution command) { return Validating(command, () => { _service.Execute(command); return RedirectToAction("List"); }); }
public void Execute(CreateSolution command) { _validation.AssertValidity(command); try { // this bounded context (Admin) Solution solution = createSnapshot(command); updateModelForCreation(solution); // another bounded context (DefectHandling) createHandlingSnapshot(solution); updateHandlingModel(solution); _models.SaveChanges(); } catch (Exception) { _snapshots.RollbackChanges(); throw; } }
private Solution createSnapshot(CreateSolution command) { Solution solution = new Solution(command.Name); _snapshots.Save(solution); return solution; }