Browse Source

Query decimal to enum bug

pull/20/head
sunkaixuan 2 years ago
parent
commit
03ad0c66c6
  1. 8
      Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs

8
Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs

@ -346,6 +346,10 @@ namespace SqlSugar
{
addValue = Convert.ToInt64(addValue);
}
else if (UtilMethods.GetUnderType(item.PropertyType).IsEnum()&& addValue is decimal)
{
addValue = Convert.ToInt64(addValue);
}
result.Add(name, addValue);
}
}
@ -442,6 +446,10 @@ namespace SqlSugar
{
addItem = addItem.ObjToInt();
}
else if (prop.PropertyType.IsEnum()&&addItem is decimal)
{
addItem = Convert.ToInt64(addItem);
}
result.Add(name, addItem);
}
}

Loading…
Cancel
Save