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);
        }
示例#2
0
文件: Given.cs 项目: legendz3/Siege
        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);
        }