/// <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 MySqlParameter parameter = (MySqlParameter)base.AddParameter(value, token, dbType, size, precision, scale, direction); parameter.DbType(dbType); return(parameter); }
/// <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 MySqlParameter mySqlParameter = (MySqlParameter)base.CreateParameter(value, context, dbType, size, precision, scale, direction); mySqlParameter.DbType(dbType); return(mySqlParameter); }