Пример #1
0
        /// <summary>
        /// 增加一个SQL参数
        /// </summary>
        /// <param name="value">值</param>
        /// <param name="token">解析SQL命令时的参数上下文</param>
        /// <param name="dbType">数据类型</param>
        /// <param name="size">长度</param>
        /// <param name="precision">精度</param>
        /// <param name="scale">小数位</param>
        /// <param name="direction">查询参数类型</param>
        /// <returns></returns>
        protected override IDbDataParameter AddParameter(object value, ResolveToken token,
                                                         object dbType, int?size = null, int?precision = null, int?scale = null, ParameterDirection?direction = null)
        {
            // 补充 DbType
            SqlParameter parameter = (SqlParameter)base.AddParameter(value, token, dbType, size, precision, scale, direction);

            parameter.DbType(dbType);
            return(parameter);
        }
Пример #2
0
        /// <summary>
        /// 增加一个SQL参数
        /// </summary>
        /// <param name="value">值</param>
        /// <param name="context">解析SQL命令时的参数上下文</param>
        /// <param name="dbType">数据类型</param>
        /// <param name="size">长度</param>
        /// <param name="precision">精度</param>
        /// <param name="scale">小数位</param>
        /// <param name="direction">查询参数类型</param>
        /// <returns></returns>
        protected override IDbDataParameter CreateParameter(object value, ITranslateContext context,
                                                            object dbType, int?size = null, int?precision = null, int?scale = null, ParameterDirection?direction = null)
        {
            // 补充 DbType
            SqlParameter sqlParameter = (SqlParameter)base.CreateParameter(value, context, dbType, size, precision, scale, direction);

            sqlParameter.DbType(dbType);
            return(sqlParameter);
        }