public static RulesEngine New(Action <RulesEngineConfigurator> configureCallback) { if (configureCallback == null) { throw new ArgumentNullException("configureCallback"); } var configurator = new RulesEngineConfiguratorImpl(); configureCallback(configurator); ConfigurationResult result = ConfigurationResultImpl.CompileResults(configurator.ValidateConfiguration()); try { RulesEngine engine = configurator.Create(); return(engine); } catch (Exception ex) { throw new ConfigurationException(result, "An exception was thrown during rules engine creation", ex); } }
public static RulesEngine New(Action<RulesEngineConfigurator> configureCallback) { if (configureCallback == null) throw new ArgumentNullException("configureCallback"); var configurator = new RulesEngineConfiguratorImpl(); configureCallback(configurator); ConfigurationResult result = ConfigurationResultImpl.CompileResults(configurator.ValidateConfiguration()); try { RulesEngine engine = configurator.Create(); return engine; } catch (Exception ex) { throw new ConfigurationException(result, "An exception was thrown during rules engine creation", ex); } }