Update enum bug

This commit is contained in:
sunkaixuan
2022-10-19 13:44:15 +08:00
parent 16b7112c1c
commit 2df7a440fe

View File

@@ -323,9 +323,16 @@ namespace SqlSugar
{
var valueType = value.GetType();
if (valueType.IsIn(UtilConstants.FloatType, UtilConstants.DecType, UtilConstants.DobType))
{
if (Convert.ToDecimal(value) < 0)
{
value = Convert.ToInt32(value);
}
else
{
value = Convert.ToUInt32(value);
}
}
else if (valueType == UtilConstants.StringType)
{
return (T)Enum.Parse(typeof(T), value.ObjToString());