Example #1
0
        public RuleEngine(DataContext context)
        {
            this.context = context;

            proxyProvider = new ProxyProvider(this);
            tagManager = new TagManager(this);
            helperProvider = new HelperProvider(this);

            ExtractCompiledAssemblyFile();
        }
Example #2
0
        public HelperInfo(HelperProvider provider, Type type)
        {
            this.provider = provider;

            var attribute = type.GetCustomAttributes(typeof(HelperAttribute), false).Cast<HelperAttribute>().Single();
            Name = attribute.Name;
            InterfaceType = attribute.InterfaceType;
            DebugModeOnly = attribute.DebugModeOnly;

            var newExpr = Expression.New(type.GetConstructor(ctorParameters), ruleContextParameterExpr);
            creator = Expression.Lambda<Func<CompiledRuleContext, object>>(newExpr, ruleContextParameterExpr).Compile();
        }
Example #3
0
        public HelperInfo(HelperProvider provider, Type type)
        {
            this.provider = provider;

            var attribute = type.GetCustomAttributes(typeof(HelperAttribute), false).Cast <HelperAttribute>().Single();

            Name          = attribute.Name;
            InterfaceType = attribute.InterfaceType;
            DebugModeOnly = attribute.DebugModeOnly;

            var newExpr = Expression.New(type.GetConstructor(ctorParameters), ruleContextParameterExpr);

            creator = Expression.Lambda <Func <CompiledRuleContext, object> >(newExpr, ruleContextParameterExpr).Compile();
        }