예제 #1
0
		public ActionResult Rename(RenameSolution command)
		{
			return Validating(command, () =>
			{
				_service.Execute(command);
				return RedirectToAction("List");
			});
		}
예제 #2
0
		public Solution renameSnapshot(RenameSolution command)
		{
			Solution old = _snapshots.Single<Solution>(s => s.Id == command.Id);
			old.Rename(command.NewName);
			_snapshots.Save(old);
			return old;
		}
예제 #3
0
		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;
			}
		}
예제 #4
0
		public ActionResult Rename(Guid id)
		{
			Solution solution = _queries.GetSolution(id);
			var mapped = new RenameSolution(id, solution.Name);
			return View(mapped);
		}