Esempio n. 1
0
        public Task Handle(PolicyTerminated @event, CancellationToken cancellationToken)
        {
            policyInfoDtoProjection.UpdatePolicyInfoDto(@event.TerminatedPolicy, @event.TerminatedVersion);

            policyVersionDtoProjection.CreatePolicyVersionDtoProjection(@event.TerminatedPolicy, @event.TerminatedVersion);

            return(Task.CompletedTask);
        }
        public Task Handle(PolicyCreated @event, CancellationToken cancellationToken)
        {
            policyInfoDtoProjection.CreatePolicyInfoDto(@event.NewPolicy);

            policyVersionDtoProjection.CreatePolicyVersionDtoProjection(@event.NewPolicy, @event.NewPolicy.Versions.WithNumber(1));

            return(Task.CompletedTask);
        }