Beispiel #1
0
        public LuaSqlConfigExecutor(ILuaSqlConfigManager sqlConfigMgr, DbContext db,
                                    IDictionary <string, IDictionary <string, object> > luaSqlParamFuncContainer,
                                    string tableName, string sqlName, ILuaConfigSqlInfo sqlInfo, ILuaConfigTableInfo tableInfo,
                                    ISqlExecutor sqlExecutor, ISqlParamConverter sqlParamCvt, IEFCoreExtendUtility util)
        {
            _luaSqlParamFuncContainer = luaSqlParamFuncContainer;
            _sqlConfigMgr             = sqlConfigMgr;
            _db        = db;
            _sqlInfo   = sqlInfo;
            _tableInfo = tableInfo;
            _tableName = tableName;
            _sqlName   = sqlName;

            _sqlExecutor = sqlExecutor;
            _sqlParamCvt = sqlParamCvt;
            _util        = util;
        }
        public object GetPolicy(ILuaConfigSqlInfo sqlInfo, ILuaConfigTableInfo tableInfo)
        {
            object tempPolicy = null;

            if (ParameterPolicy != null)
            {
                return(ParameterPolicy);
            }
            else if (sqlInfo?.Policies?.TryGetValue(PolicyName, out tempPolicy) == true)
            {
                return(tempPolicy);
            }
            else if (tableInfo?.Policies?.TryGetValue(PolicyName, out tempPolicy) == true)
            {
                return(tempPolicy);
            }
            else
            {
                return(GlobalPolicy);
            }
        }