public virtual async Task TriggerEntityCreatedEventOnUowCompletedAsync(object entity) { await TriggerEventWithEntity( LocalEventBus, typeof(EntityCreatedEventData <>), entity, entity, false ); if (ShouldPublishDistributedEventForEntity(entity)) { var eto = EntityToEtoMapper.Map(entity); if (eto != null) { await TriggerEventWithEntity( DistributedEventBus, typeof(EntityCreatedEto <>), eto, entity, false ); } } }
public virtual void PublishEntityCreatedEvent(object entity) { TriggerEventWithEntity(LocalEventBus, typeof(EntityCreatedEventData <>), entity, entity); if (ShouldPublishDistributedEventForEntity(entity)) { var eto = EntityToEtoMapper.Map(entity); if (eto != null) { TriggerEventWithEntity(DistributedEventBus, typeof(EntityCreatedEto <>), eto, entity); } } }