Reflection to detemine collection or implement of IEnumerable

C

cwertman

I have an app that I have several functions I need to determine if a
given propety is a a type of Collection

It could (and in most cases is) a Generic Collection

It could be , and array , an array list , etc though.

How can I determine if its A collection, or enumerable ?

It would seem to be easiest to determine if the property implements (or
parent) IEnumerable , dosent this make sense ?
BUT
I cannot find a way to determine at any level if a property implements
IEnumerable even.

Any help is greatly appreciated.

Thanks

Chris
 
C

cwertman

Ok, so far so good.

Now for example a property I may not know the type like a generic
collection

How can I determine that that given Property implements a given
interface, for example we know that a Generic CCollection implements
IEnumerable, and so does an Array.

These (IEnumerable) are the buggers I need to get my hands on.

Thanks

Chris
 

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

Top