示例#1
0
        internal DomaSqlBuilder(ISqlNode node, object model,
                                SqlParserConfig config, EasyExpressionEvaluator evaluator)
        {
            _node   = node;
            _config = config;
            var valueObjectWrapper = ValueObjectCache.GetValueObjects(model, _config);

            _propertyValues     = valueObjectWrapper.PropertyValues;
            _valueObjects       = valueObjectWrapper.ValueObjects;
            ExpressionEvaluator = evaluator;
        }
示例#2
0
        //private readonly EasyExpressionEvaluator _evaluator;

        // for unit test
        internal DomaSqlBuilder(ISqlNode node, List <ParameterEmulator> emulators,
                                SqlParserConfig config = null, string sqlFilePath = null)
        {
            _node   = node;
            _config = config ?? ConfigContainer.DefaultConfig;
            var valueObjectWrapper = ValueObjectCache.GetValueObjects(emulators, _config);

            _propertyValues = valueObjectWrapper.PropertyValues;
            _valueObjects   = valueObjectWrapper.ValueObjects;
            if (string.IsNullOrEmpty(sqlFilePath))
            {
                ExpressionEvaluator = new EasyExpressionEvaluator();
            }
            else
            {
                ExpressionEvaluator = new EasyExpressionEvaluator(sqlFilePath);
            }
        }