📜  将 dto 转换为字典 c# 代码示例

📅  最后修改于: 2022-03-11 14:49:22.084000             🧑  作者: Mango

代码示例1
someObject.GetType()
     .GetProperties(BindingFlags.Instance | BindingFlags.Public)
          .ToDictionary(prop => prop.Name, prop => prop.GetValue(someObject, null))