Exemple #1
0
        public void Handle(RenameInventoryItem message)
        {
            var item = repository.Get(message.InventoryItemId);

            item.ChangeName(message.NewName);
            item.CorrelationId = message.Id;
            repository.Save(item);
        }
Exemple #2
0
        private void btnRename_Click(object sender, EventArgs e)
        {
            var id      = Guid.NewGuid(); //TODO:获取已经存在的Id
            var newName = this.txtName.Text;
            var command = new RenameInventoryItem(id, newName);

            commandBus.Send(command);
        }