kromm77 icon

C# Object Properties into a Dictionary

kromm77 | PRO | 03/03/17 01:40:15 PM UTC | 0 ⭐ | 470 👁️ | Never ⏰ | []
C# |

200 B

|

None

|

0 👍

/

0 👎

List<string> list = new List<string>();
PropertyInfo[] fields = object.GetType().GetProperties();
foreach (PropertyInfo f in fields)
{
    list.Add( f.Name, string.Format("{0}", f.GetValue(object)));
}

Comments