How do I get a list of all the properties of a class?
C# – How to get the list of properties of a class
.netc++propertiesreflection
Related Question
- C# – How to enumerate an enum
- Javascript – How to efficiently count the number of keys/properties of an object in JavaScript
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- C# – Get int value from enum in C#
- C# – Get property value from string using reflection
- C# – How to Sort a List
by a property in the object - C# – Why not inherit from List
Best Solution
Reflection; for an instance:
for a type:
for example:
Following feedback...
null
as the first argument toGetValue
GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
(which returns all public/private instance properties ).