In some part of my code I am passed a collection of objects of type T
. I don't know which concrete colletion I will be passed, other than it impements IEnumerable
.
At run time, I need to find out which type T is (e.g. System.Double
, System.String
, etc...).
Is there any way to find it out?
UPDATE: I should maybe clarify a bit more the context I am working in (a Linq Provider).
My function has a signature like the following, where I get the type of the collection as a parameter:
string GetSymbolForType(Type collectionType)
{
}
Is there any way from collectionType
to get the contained objects type?