protected override void OnWizardClosed(DialogResult result) { if(result == DialogResult.OK) { var command = new UpdateProjectSupplyCommand( this.supply.ProjectId, this.supply.Id, editSupplyPage.TypedPage.Quantity, editSupplyPage.TypedPage.Price); this.EventBroker.Publish(command, Topics.COMMANDS); } }
public void ProcessAction(UpdateProjectSupplyCommand eventObject) { var project = this.projectRepository.FindById(eventObject.ProjectId); var projectSupply = project.Supplies.Where(x => x.Id == eventObject.Id).First(); Mapper.CreateMap<UpdateProjectSupplyCommand, ProjectSupply>(); Mapper.Map(eventObject, projectSupply); this.projectRepository.Save(project); this.eventBroker.Publish(new ProjectSupplyUpdatedEvent(project.Id, projectSupply.Id), Topics.EVENTS); }