mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 12:47:57 +08:00
1. .net core 3.0 preview3+ BUG
2. Oracle long bug
This commit is contained in:
parent
ebb6ef36a1
commit
024e6872c5
@ -176,7 +176,8 @@ namespace SqlSugar
|
||||
MethodInfo method = null;
|
||||
Type bindPropertyType = UtilMethods.GetUnderType(columnInfo.PropertyInfo, ref isNullableType);
|
||||
string dbTypeName = UtilMethods.GetParenthesesValue(DataRecord.GetDataTypeName(ordinal));
|
||||
if (dbTypeName.IsNullOrEmpty()) {
|
||||
if (dbTypeName.IsNullOrEmpty())
|
||||
{
|
||||
dbTypeName = bindPropertyType.Name;
|
||||
}
|
||||
string propertyName = columnInfo.PropertyName;
|
||||
@ -207,6 +208,10 @@ namespace SqlSugar
|
||||
{
|
||||
method = getConvertValueMethod.MakeGenericMethod(columnInfo.PropertyInfo.PropertyType);
|
||||
}
|
||||
|
||||
if (method.IsVirtual)
|
||||
generator.Emit(OpCodes.Callvirt, method);
|
||||
else
|
||||
generator.Emit(OpCodes.Call, method);
|
||||
return;
|
||||
};
|
||||
@ -260,7 +265,8 @@ namespace SqlSugar
|
||||
method = isNullableType ? getConvertDouble : getDouble;
|
||||
else
|
||||
method = isNullableType ? getConvertFloat : getFloat;
|
||||
if (dbTypeName.Equals("float",StringComparison.CurrentCultureIgnoreCase) && isNullableType && bindProperyTypeName.Equals("single",StringComparison.CurrentCultureIgnoreCase)) {
|
||||
if (dbTypeName.Equals("float", StringComparison.CurrentCultureIgnoreCase) && isNullableType && bindProperyTypeName.Equals("single", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
method = getConvertDoubleToFloat;
|
||||
}
|
||||
if (bindPropertyType == UtilConstants.DecType)
|
||||
@ -313,6 +319,9 @@ namespace SqlSugar
|
||||
if (method == null)
|
||||
method = isNullableType ? getOtherNull.MakeGenericMethod(bindPropertyType) : getOther.MakeGenericMethod(bindPropertyType);
|
||||
|
||||
if (method.IsVirtual)
|
||||
generator.Emit(OpCodes.Callvirt, method);
|
||||
else
|
||||
generator.Emit(OpCodes.Call, method);
|
||||
#endregion
|
||||
}
|
||||
|
@ -311,6 +311,10 @@ namespace SqlSugar
|
||||
{
|
||||
addValue = Convert.ToInt32(addValue);
|
||||
}
|
||||
else if (UtilMethods.GetUnderType(item.PropertyType) == UtilConstants.LongType)
|
||||
{
|
||||
addValue = Convert.ToInt64(addValue);
|
||||
}
|
||||
result.Add(name, addValue);
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,12 @@ namespace SqlSugar
|
||||
}
|
||||
public partial class OracleMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
public override string ToInt64(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
return string.Format(" CAST({0} AS Number)", parameter.MemberName);
|
||||
}
|
||||
|
||||
public override string ToTime(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
|
Loading…
Reference in New Issue
Block a user