public void Handle(CustomAttributeUnitOfMeasureSetEvent @event) { try { EventStore.Save(@event); } catch { throw; } }
public async Task SetAttributeUnitOfMeasure(Guid attributeId, string unitOfMeasure) { try { var attribute = await Repository.GetByKeyAsync <CustomAttribute>(attributeId); attribute.SetUnitOfMeasure(unitOfMeasure); await Repository.SaveChangesAsync(); var @event = new CustomAttributeUnitOfMeasureSetEvent(attributeId, unitOfMeasure); EventBus.RaiseEvent(@event); } catch { throw; } }