diff --git a/Source/EventFlow/Aggregates/AggregateStore.cs b/Source/EventFlow/Aggregates/AggregateStore.cs index d3150bb57..ff4444c83 100644 --- a/Source/EventFlow/Aggregates/AggregateStore.cs +++ b/Source/EventFlow/Aggregates/AggregateStore.cs @@ -52,6 +52,7 @@ public class AggregateStore : IAggregateStore private readonly ICancellationConfiguration _cancellationConfiguration; private readonly IAggregateStoreResilienceStrategy _aggregateStoreResilienceStrategy; private readonly IEventFlowConfiguration _eventFlowConfiguration; + private readonly IDomainEventPublisher _domainEventPublisher; public AggregateStore( ILogger logger, @@ -62,7 +63,8 @@ public AggregateStore( ITransientFaultHandler transientFaultHandler, ICancellationConfiguration cancellationConfiguration, IAggregateStoreResilienceStrategy aggregateStoreResilienceStrategy, - IEventFlowConfiguration eventFlowConfiguration) + IEventFlowConfiguration eventFlowConfiguration, + IDomainEventPublisher domainEventPublisher) { _logger = logger; _serviceProvider = serviceProvider; @@ -73,6 +75,7 @@ public AggregateStore( _cancellationConfiguration = cancellationConfiguration; _aggregateStoreResilienceStrategy = aggregateStoreResilienceStrategy; _eventFlowConfiguration = eventFlowConfiguration; + _domainEventPublisher = domainEventPublisher; } public async Task LoadAsync( @@ -206,8 +209,7 @@ await _aggregateStoreResilienceStrategy.BeforeEventPublishAsync(); - await domainEventPublisher.PublishAsync( + await _domainEventPublisher.PublishAsync( aggregateUpdateResult.DomainEvents, cancellationToken) .ConfigureAwait(false); diff --git a/Source/EventFlow/ValueObjects/SingleValueObjectConverter.cs b/Source/EventFlow/ValueObjects/SingleValueObjectConverter.cs index 856283d52..8f1c06a7d 100644 --- a/Source/EventFlow/ValueObjects/SingleValueObjectConverter.cs +++ b/Source/EventFlow/ValueObjects/SingleValueObjectConverter.cs @@ -62,10 +62,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist return Activator.CreateInstance(objectType, value); } - - public override bool CanConvert(Type objectType) - { - return typeof(ISingleValueObject).GetTypeInfo().IsAssignableFrom(objectType); - } + public override bool CanConvert(Type objectType) => typeof(ISingleValueObject).GetTypeInfo().IsAssignableFrom(objectType); + } } \ No newline at end of file