Пример #1
0
        public ActionResult ChangeName(Guid id, string name, int version)
        {
            var command = new RenameInventoryItem(id, name, version);
            _bus.Send(command);

            return RedirectToAction("Index");
        }
Пример #2
0
 public void Handle(RenameInventoryItem message)
 {
     var item = _repository.GetById(message.InventoryItemId);
     item.ChangeName(message.NewName);
     _repository.Save(item, message.OriginalVersion);
 }