Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (25 sloc) 1.15 KB
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using SeparateModels.Domain;
using SeparateModels.ReadModels;
namespace SeparateModels.EventHandlers
{
public class PolicyChangesCancelledProjectionsHandler :
INotificationHandler<PolicyAnnexCancelled>
{
private readonly PolicyInfoDtoProjection policyInfoDtoProjection;
private readonly PolicyVersionDtoProjection policyVersionDtoProjection;
public PolicyChangesCancelledProjectionsHandler(PolicyInfoDtoProjection policyInfoDtoProjection, PolicyVersionDtoProjection policyVersionDtoProjection)
{
this.policyInfoDtoProjection = policyInfoDtoProjection;
this.policyVersionDtoProjection = policyVersionDtoProjection;
}
public Task Handle(PolicyAnnexCancelled @event, CancellationToken cancellationToken)
{
policyInfoDtoProjection.UpdatePolicyInfoDto(@event.Policy, @event.CurrentVersionAfterAnnexCancellation);
policyVersionDtoProjection.UpdatePolicyVersionDtoProjection(@event.CancelledAnnexVersion);
return Task.CompletedTask;
}
}
}
You can’t perform that action at this time.