Пример #1
0
        public void FinishRegistration(
            RegistrationPassedEvent passedEvent)
        {
            _logger.LogDebug("Reference Number: {refNum}",
                             passedEvent.ReferenceNumber);

            // React to domain-event by calling repositories,
            // services and domain-entities.
        }
        private Task NotifyPassedRegistration(
            RegistrationStatus status,
            RegisterAutoCommand command)
        {
            if (status.IsSuccess)
            {
                var passedEvent = new RegistrationPassedEvent(
                    status.ReferenceNumber, command.State);

                return(_messaging.PublishAsync(passedEvent));
            }
            return(Task.CompletedTask);
        }