public static void Rule <TRule>(this RulesEngineConfigurator configurator, Func <TRule> ruleFactory) where TRule : RuleDefinition { TRule ruleDesigner = ruleFactory(); Rule rule = ruleDesigner.Build(); configurator.Add(rule); }
public static void Rule <TRule>(this RulesEngineConfigurator configurator) where TRule : RuleDefinition, new() { Rule(configurator, () => new TRule()); }