just cast it to object
:
Type type = ((object)readings).GetType();
Being dynamic
means that all calls can be intercepted, but that's a compiler trick, not an inherent feature of the type. Casting it to object
means that the compiler stops doing that. Behind the scenes, dynamic
is just a fancy word for object
anyway.
Note, however, that it is usually a bad idea to mix reflection (GetType()
) and dynamic
; while objects can work as dynamic
(by re-exposing the reflection API as dynamic
), this is not always the case, and many (most?) implementations of dynamic
are presenting entirely artificial members that do not exist in terms of reflection. That's kinda the main point of dynamic
, with "oh, it also lets you be lazy and talk to types without knowing their type" just a handy side-effect.