Merge branch 'SqlSugar5' of github.com:donet5/SqlSugar

This commit is contained in:
sunkaixuan
2022-07-19 18:10:07 +08:00
2 changed files with 12 additions and 8 deletions

View File

@@ -302,11 +302,12 @@ namespace SqlSugar
object value = dr.GetValue(i); object value = dr.GetValue(i);
if (value != null) if (value != null)
{ {
if (value.GetType() == UtilConstants.DecType) var valueType = value.GetType();
if (valueType.IsIn(UtilConstants.FloatType, UtilConstants.DecType, UtilConstants.DobType))
{ {
value = Convert.ToUInt32(value); value = Convert.ToUInt32(value);
} }
else if (value.GetType() == UtilConstants.StringType) else if (valueType == UtilConstants.StringType)
{ {
return (T)Enum.Parse(typeof(T), value.ObjToString()); return (T)Enum.Parse(typeof(T), value.ObjToString());
} }
@@ -320,11 +321,12 @@ namespace SqlSugar
object value = dr.GetValue(i); object value = dr.GetValue(i);
if (value != null) if (value != null)
{ {
if (value.GetType() == UtilConstants.DecType) var valueType = value.GetType();
if (valueType.IsIn(UtilConstants.FloatType, UtilConstants.DecType, UtilConstants.DobType))
{ {
value = Convert.ToUInt32(value); value = Convert.ToUInt32(value);
} }
else if (value.GetType() == UtilConstants.StringType) else if (valueType == UtilConstants.StringType)
{ {
return (T)Enum.Parse(typeof(T), value.ObjToString()); return (T)Enum.Parse(typeof(T), value.ObjToString());
} }

View File

@@ -302,11 +302,12 @@ namespace SqlSugar
object value = dr.GetValue(i); object value = dr.GetValue(i);
if (value != null) if (value != null)
{ {
if (value.GetType() == UtilConstants.DecType) var valueType = value.GetType();
if (valueType.IsIn(UtilConstants.FloatType, UtilConstants.DecType, UtilConstants.DobType))
{ {
value = Convert.ToUInt32(value); value = Convert.ToUInt32(value);
} }
else if (value.GetType() == UtilConstants.StringType) else if (valueType == UtilConstants.StringType)
{ {
return (T)Enum.Parse(typeof(T), value.ObjToString()); return (T)Enum.Parse(typeof(T), value.ObjToString());
} }
@@ -320,11 +321,12 @@ namespace SqlSugar
object value = dr.GetValue(i); object value = dr.GetValue(i);
if (value != null) if (value != null)
{ {
if (value.GetType() == UtilConstants.DecType) var valueType = value.GetType();
if (valueType.IsIn(UtilConstants.FloatType, UtilConstants.DecType, UtilConstants.DobType))
{ {
value = Convert.ToUInt32(value); value = Convert.ToUInt32(value);
} }
else if (value.GetType() == UtilConstants.StringType) else if (valueType == UtilConstants.StringType)
{ {
return (T)Enum.Parse(typeof(T), value.ObjToString()); return (T)Enum.Parse(typeof(T), value.ObjToString());
} }