public bool AddNotifications(IDomainNotifier notifier)
        {
            if (!notifier.IsValid)
            {
                foreach (DomainNotification notification in notifier.GetNotifications())
                {
                    AddNotification(notification);
                }

                return(true);
            }

            return(false);
        }
Пример #2
0
        protected bool AddNotifications(IDomainNotifier notifier)
        {
            _logger.LogInformation("Validador de domínio recebido: {notifier}", notifier);

            if (!notifier.IsValid)
            {
                foreach (DomainNotification notification in notifier.GetNotifications())
                {
                    AddNotification(notification.Title, notification.Description);
                }

                _logger.LogWarning("Validação de domínio {notifier} falhou: {notifications}", notifier.GetNotificationsAsDictionary());
                return(true);
            }

            _logger.LogInformation("Validador de domínio {notifier} feita com sucesso.", notifier);
            return(false);
        }
Пример #3
0
 protected CommandResult FailureDueToEntityStateInconsistency(IDomainNotifier domainNotifier)
 {
     return(CommandResult.Failure(domainNotifier
                                  .GetNotifications()
                                  .ToList()));
 }