[ACCEPTED]-How do I test for typeof(dynamic)?-c#-4.0

Accepted answer
Score: 11

Simply speaking you cannot because there 6 is no type dynamic. In type dynamic is 5 written out as object with a special attribute 4 attached (Dynamic) if the type appears in 3 metadata. Essentially saying typeof(dynamic) is 2 no different than typeof(object) for most 1 purposes.

Score: 1

It is not necessary for object declared 7 as dynamic to be some specific type of object. It 6 can be a subclass of DynamicObject (and thus provide 5 specific logic for operations lookup), but 4 it can be a normal object as well (as @JaredPar 3 said).

Maybe, if you explain what sort of 2 branch you want to make for dynamic objects it 1 would be possible to find better solution.

More Related questions