I have the following object:
dynamic person = new {Id = 1, Name = "SpiderMan"};
I need to be able to iterate over property names, for example. "Id" , "Name" .
I also need to be able to achieve this in the most efficient way, so I decided to use FastMember , however this api does not allow me to iterate through the properties.
Any ideas?
[UPDATE]
Thanks to Marc, I managed to achieve what I wanted to use:
dynamic person = new { Id = 1, Name = "SpiderMan" }; MemberSet members = TypeAccessor.Create(person.GetType()).GetMembers(); foreach (Member item in members) {
MaYaN source share