mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
1. .net core 3.0 preview3+ BUG
2. Oracle long bug
This commit is contained in:
parent
ebb6ef36a1
commit
024e6872c5
@ -76,7 +76,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDataReaderEntityBuilder(SqlSugarProvider context, IDataRecord dataRecord,List<string> fieldNames)
|
public IDataReaderEntityBuilder(SqlSugarProvider context, IDataRecord dataRecord, List<string> fieldNames)
|
||||||
{
|
{
|
||||||
this.Context = context;
|
this.Context = context;
|
||||||
this.DataRecord = dataRecord;
|
this.DataRecord = dataRecord;
|
||||||
@ -104,7 +104,7 @@ namespace SqlSugar
|
|||||||
foreach (var columnInfo in columnInfos)
|
foreach (var columnInfo in columnInfos)
|
||||||
{
|
{
|
||||||
string fileName = columnInfo.DbColumnName ?? columnInfo.PropertyName;
|
string fileName = columnInfo.DbColumnName ?? columnInfo.PropertyName;
|
||||||
if (columnInfo.IsIgnore&& !this.ReaderKeys.Any(it=>it.Equals(fileName,StringComparison.CurrentCultureIgnoreCase)))
|
if (columnInfo.IsIgnore && !this.ReaderKeys.Any(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
if (this.ReaderKeys.Any(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase)))
|
if (this.ReaderKeys.Any(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
BindClass(generator, result, columnInfo,ReaderKeys.First(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase)));
|
BindClass(generator, result, columnInfo, ReaderKeys.First(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -176,7 +176,8 @@ namespace SqlSugar
|
|||||||
MethodInfo method = null;
|
MethodInfo method = null;
|
||||||
Type bindPropertyType = UtilMethods.GetUnderType(columnInfo.PropertyInfo, ref isNullableType);
|
Type bindPropertyType = UtilMethods.GetUnderType(columnInfo.PropertyInfo, ref isNullableType);
|
||||||
string dbTypeName = UtilMethods.GetParenthesesValue(DataRecord.GetDataTypeName(ordinal));
|
string dbTypeName = UtilMethods.GetParenthesesValue(DataRecord.GetDataTypeName(ordinal));
|
||||||
if (dbTypeName.IsNullOrEmpty()) {
|
if (dbTypeName.IsNullOrEmpty())
|
||||||
|
{
|
||||||
dbTypeName = bindPropertyType.Name;
|
dbTypeName = bindPropertyType.Name;
|
||||||
}
|
}
|
||||||
string propertyName = columnInfo.PropertyName;
|
string propertyName = columnInfo.PropertyName;
|
||||||
@ -207,7 +208,11 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
method = getConvertValueMethod.MakeGenericMethod(columnInfo.PropertyInfo.PropertyType);
|
method = getConvertValueMethod.MakeGenericMethod(columnInfo.PropertyInfo.PropertyType);
|
||||||
}
|
}
|
||||||
generator.Emit(OpCodes.Call, method);
|
|
||||||
|
if (method.IsVirtual)
|
||||||
|
generator.Emit(OpCodes.Callvirt, method);
|
||||||
|
else
|
||||||
|
generator.Emit(OpCodes.Call, method);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
#endregion
|
#endregion
|
||||||
@ -245,7 +250,7 @@ namespace SqlSugar
|
|||||||
CheckType(bind.DateThrow, bindProperyTypeName, validPropertyName, propertyName);
|
CheckType(bind.DateThrow, bindProperyTypeName, validPropertyName, propertyName);
|
||||||
if (bindProperyTypeName == "datetime")
|
if (bindProperyTypeName == "datetime")
|
||||||
method = isNullableType ? getConvertDateTime : getDateTime;
|
method = isNullableType ? getConvertDateTime : getDateTime;
|
||||||
if (bindProperyTypeName == "datetime"&&dbTypeName.ToLower() == "time")
|
if (bindProperyTypeName == "datetime" && dbTypeName.ToLower() == "time")
|
||||||
method = isNullableType ? getConvertTime : getTime;
|
method = isNullableType ? getConvertTime : getTime;
|
||||||
break;
|
break;
|
||||||
case CSharpDataType.@decimal:
|
case CSharpDataType.@decimal:
|
||||||
@ -256,11 +261,12 @@ namespace SqlSugar
|
|||||||
case CSharpDataType.@float:
|
case CSharpDataType.@float:
|
||||||
case CSharpDataType.@double:
|
case CSharpDataType.@double:
|
||||||
CheckType(bind.DoubleThrow, bindProperyTypeName, validPropertyName, propertyName);
|
CheckType(bind.DoubleThrow, bindProperyTypeName, validPropertyName, propertyName);
|
||||||
if (bindProperyTypeName.IsIn( "double", "single")&&dbTypeName!="real")
|
if (bindProperyTypeName.IsIn("double", "single") && dbTypeName != "real")
|
||||||
method = isNullableType ? getConvertDouble : getDouble;
|
method = isNullableType ? getConvertDouble : getDouble;
|
||||||
else
|
else
|
||||||
method = isNullableType ? getConvertFloat : getFloat;
|
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;
|
method = getConvertDoubleToFloat;
|
||||||
}
|
}
|
||||||
if (bindPropertyType == UtilConstants.DecType)
|
if (bindPropertyType == UtilConstants.DecType)
|
||||||
@ -313,7 +319,10 @@ namespace SqlSugar
|
|||||||
if (method == null)
|
if (method == null)
|
||||||
method = isNullableType ? getOtherNull.MakeGenericMethod(bindPropertyType) : getOther.MakeGenericMethod(bindPropertyType);
|
method = isNullableType ? getOtherNull.MakeGenericMethod(bindPropertyType) : getOther.MakeGenericMethod(bindPropertyType);
|
||||||
|
|
||||||
generator.Emit(OpCodes.Call, method);
|
if (method.IsVirtual)
|
||||||
|
generator.Emit(OpCodes.Callvirt, method);
|
||||||
|
else
|
||||||
|
generator.Emit(OpCodes.Call, method);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,6 +311,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
addValue = Convert.ToInt32(addValue);
|
addValue = Convert.ToInt32(addValue);
|
||||||
}
|
}
|
||||||
|
else if (UtilMethods.GetUnderType(item.PropertyType) == UtilConstants.LongType)
|
||||||
|
{
|
||||||
|
addValue = Convert.ToInt64(addValue);
|
||||||
|
}
|
||||||
result.Add(name, addValue);
|
result.Add(name, addValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,12 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public partial class OracleMethod : DefaultDbMethod, IDbMethods
|
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)
|
public override string ToTime(MethodCallExpressionModel model)
|
||||||
{
|
{
|
||||||
var parameter = model.Args[0];
|
var parameter = model.Args[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user