Ejemplo n.º 1
0
        public void CreateRules()
        {
            var factory = new RuleFactory <Entity>();

            factory.CreateActionRule(en => en.Name.ToString());
            factory.CreateActionRuleWithoutDependency(en => en.Name.ToString())
            .WithDependencies(en => en.Number);

            factory.CreateValidationRule(en => en.Number < 10);
            factory.CreateValidationRuleWithoutDependency(en => en.Number < 10)
            .WithDependencies(en => en.Number);

            factory.CreateBusinessRule(en => en.Number2 + en.Number3, en => en.Number);
        }