public static IRuleDefinition RuleDefinitionMapper(ICategoryDefinition parentCategoryDefinition, Model.RuleDefinition ruleDefinition) { IRuleDefinition rule = null; try { rule = ConfigurationComponentFactory().ConfigurationFactory <IRuleDefinition>(typeof(IRuleDefinition)); } catch (Exception e) { throw new DataAccessComponentException(null, -1, "Configuration proxy factory failure - unable to create an instance of " + typeof(IRuleDefinition) + "?", e); } try { rule.Id = ruleDefinition.Id; rule.Enabled = ruleDefinition.Enabled; rule.ParentDefinition = parentCategoryDefinition; rule.RuleDeclarationReferenceId = ruleDefinition.RuleDeclaration.Id; rule.RuleDeclarationReferenceName = ruleDefinition.RuleDeclaration.Name; } catch (Exception e) { throw new DataAccessComponentException(null, -1, "Mapping process failure?", e); } return(rule); }
public static IRuleDefinition RuleDefinitionMapper(Model.RuleDefinition ruleDefinition) { return(RuleDefinitionMapper(null, ruleDefinition)); }