예제 #1
0
        public virtual bool EhValido()
        {
            if (this._regra.ObterRegras().Count().Equals(0))
            {
                LoggerEscp escopo = new LoggerEscp();
                this._regra.AdicionarRegra(escopo.NomeEhValido <Logger>(x => x.Usuario.Nome));
                this._regra.AdicionarRegra(escopo.NivelLoggerEhValido <Logger>(x => x.Nivel));
                this._regra.AdicionarRegra(escopo.RastreioEhValido <Logger>(x => x.Rastreio));
                this._regra.AdicionarRegra(escopo.CriadoEmEhValido <Logger>(x => x.CriadoEm));
                this._regra.AdicionarRegra(escopo.UsuarioEhValido <Logger>(x => x.Usuario.Id));
            }

            this.Notificacoes = this._regra.Validar(this);
            return(this.Notificacoes.EhValido());
        }