public bool AddNotifications(IDomainNotifier notifier) { if (notifier.HasNotifications()) { _domainNotificationHandler.AddNotifications(notifier); return(true); } return(false); }
public bool AddNotifications(IDomainNotifier notifier) { if (!notifier.IsValid) { foreach (DomainNotification notification in notifier.GetNotifications()) { AddNotification(notification); } return(true); } return(false); }
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); }
/// <summary> /// Add ValidationErrors to a DomainNotification list. /// </summary> /// <param name="validationErrors">This list of validation errors</param> /// <param name="notifier">INotifier object that carries the list</param> public static void AddToNotifier(this IReadOnlyList <ValidationError> validationErrors, IDomainNotifier notifier) { foreach (ValidationError error in validationErrors) { notifier.AddNotification(error.ErrorCode, error.ErrorDescription); } }
public bool AddNotifications(IDomainNotifier notifier) { return(_domainNotificationHandler.AddNotifications(notifier)); }
protected CommandResult FailureDueToEntityStateInconsistency(IDomainNotifier domainNotifier) { return(CommandResult.Failure(domainNotifier .GetNotifications() .ToList())); }