I've a method, which receive basically a dynamic
object. This is due to a dynamic dispatching, and it is not the point to discuss of why I've a dynamic
input here.
I know that this dynamic
object represent a type ASpecialClass<T>
where T is unknown at the compilation time. Is there a way to extract the T
type and give it to another method?
Like:
public void DoSomething(dynamic inputObject)//At this point, I know that it implements ASpecialClass<T>, but I don't know what is the T type
{
extracType(InputObject);
CallOtherMethod<With_the_extracted_Type>(inputObject);
}
There is two things here:
- Is there a way to extract the type
T
of the parameter? - Is it possible to provide it back to another method, which is generic?
Thank you