diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs index c861068de..62463e1f3 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs @@ -60,7 +60,15 @@ namespace IRaCIS.Core.Infrastructure.Extention string propertyName = property.Name; object propertyValue = property.GetValue(obj); - dictionary.Add(propertyName, propertyValue); + // 如果属性的类型是枚举,将其值保留为整数 + if (property.PropertyType.IsEnum) + { + dictionary.Add(propertyName, (int)propertyValue); + } + else + { + dictionary.Add(propertyName, propertyValue); + } } return dictionary;