Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Dictionary<string, object> GetPropertyValues(object obj)
- {
- var dictionary = TypeDescriptor.GetProperties(obj)
- .OfType<PropertyDescriptor>()
- .ToDictionary(p => p.Name, p => p.GetValue(obj));
- return dictionary;
- }
Advertisement
Add Comment
Please, Sign In to add comment