public void When <TContext>(Func <TContext, bool> evaluation)
        {
            var rule = new ConditionalActivationRule <TService>();

            var lambdaEvaluation = new LambdaCondition <TContext>(evaluation);

            rule.SetEvaluation(lambdaEvaluation);

            list.Add(rule);
        }
Exemplo n.º 2
0
        public static ConditionalActivationRule <TBaseService> When <TContext>(Func <TContext, bool> evaluation)
        {
            var rule = new ConditionalActivationRule <TBaseService>();

            var lambdaEvaluation = new LambdaCondition <TContext>(evaluation);

            rule.SetEvaluation(lambdaEvaluation);

            return(rule);
        }