Exemplo n.º 1
0
        public bool IsSatisfiedBy(TEntity entity, Execute execute)
        {
            var result = true;

            if (!Condition(entity))
            {
                return(result);
            }

            var executeInternal1 = new Execute();
            var executeInternal2 = new Execute();

            var result1 = Spec1.IsSatisfiedBy(entity, executeInternal1);
            var result2 = Spec2.IsSatisfiedBy(entity, executeInternal2);

            result = result1 || result2;

            if (!result && execute != null)
            {
                execute.AddMessage(executeInternal1);
                execute.AddMessage(executeInternal2);
            }

            return(result);
        }
Exemplo n.º 2
0
 public bool Is(T candidate)
 {
     return(Spec1.IsSatisfiedBy(candidate) || Spec2.IsSatisfiedBy(candidate));
 }
Exemplo n.º 3
0
 public new bool IsSatisfiedBy(T candidate)
 {
     return(Spec1.IsSatisfiedBy(candidate) && Spec2.IsSatisfiedBy(candidate));
 }
 public new bool IsSatisfiedBy(TEntity candidate)
 {
     return(Spec1.IsSatisfiedBy(candidate) || Spec2.IsSatisfiedBy(candidate));
 }