Example #1
0
        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);
        }
Example #2
0
 public void NotificarErroNegocio(string mensagem)
 {
     _notificacaoEvent.Notificar(NotificacaoDTO.NotificacaoFactory.ErroNegocio(mensagem));
 }