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); }
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); }