コード例 #1
0
 public static BouncerPolicyBuilder <T> EnsureNull <T>(this BouncerBuilder <T> builder)
 {
     return
         (builder
          .Ensure(IsNullExpression.Create <T>())
          .WithMessage($"{typeof(T).ToPrettyString()} must be null.")
          .BreakOnFailure());
 }
コード例 #2
0
        public static BouncerPolicyBuilder <T> Block <T>(this BouncerBuilder <T> builder, Expression <Func <T, bool> > expression)
        {
            var notExpression = Expression.Lambda <Func <T, bool> >(Expression.Not(expression.Body), expression.Parameters[0]);

            return(builder.Ensure(notExpression));
        }