Reflection Types

  • Thread starter Thread starter Roger Webb
  • Start date Start date
R

Roger Webb

Hey,

I'm attempting to use reflection in order to get the types of properties
in a class. However, I seem to be having trouble determining exactly which
type I am getting. In the foreach of running through the properties, the
PropertyInfo.Name does cycle through all the properties, however, if you
check the PropertyInfo.GetType().ToString() it is always
"System.Reflection.PropertyInfo". Which technically makes sense. What
doesnt make sense is that the PropertyInfo.GetType().IsEnum SEEMS to work
for each property.

So, my question is, how do I get the type of the property I am on?

Does this make sense?

- Roger
 
PropertyInfo.PropertyType is what you're looking for.

Jose Solorzano
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top