I have got an c# object and I don’t know the type of this object. (i.e. object o)
What I know is that this object has a member called ‘ID’ of type int.
I wanted to get the value of this property but I am not good enough with reflection…
I can get a type and members of this object:
Type type = obj.GetType();
System.Reflection.MemberInfo[] member = type.GetMember("ID");
…but don’t know what to do next 🙂
Thanks for help in advance
Mariusz
Is this a public property? Is so then the easiest route is to use
dynamic