修改导出
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-12 18:08:07 +08:00
parent ad7463c2c9
commit fd3fc0ea03
5 changed files with 67 additions and 6 deletions
@@ -57,15 +57,16 @@ namespace IRaCIS.Core.Infrastructure.Extention
}
Type type = obj.GetType();
PropertyInfo[] properties = type.GetProperties();
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
Dictionary<string, object> dictionary = new Dictionary<string, object>();
foreach (PropertyInfo property in properties)
{
string propertyName = property.Name;
Console.WriteLine(propertyName);
object propertyValue = property.GetValue(obj);
Console.WriteLine(propertyName);
// 如果属性的类型是枚举,将其值保留为整数
if (property.PropertyType.IsEnum || (Nullable.GetUnderlyingType(property.PropertyType)?.IsEnum == true && propertyValue!=null) )
{