protected bool ValidarViewModel(ModelStateDictionary modelState) { if (!modelState.IsValid) { var erros = modelState.Values.SelectMany(v => v.Errors); erros.ToList().ForEach (e => _notificacaoEvent.Notificar ( NotificacaoDTO.NotificacaoFactory.ErroNegocio(e.ErrorMessage) ) ); return(false); } return(true); }
public void NotificarErroNegocio(string mensagem) { _notificacaoEvent.Notificar(NotificacaoDTO.NotificacaoFactory.ErroNegocio(mensagem)); }