How to check if a generic parameter is dynamic in .NET 4.0

后端 未结 2 1424
独厮守ぢ
独厮守ぢ 2021-02-20 04:22

I have a class ObjectMapper . Is there any way in .NET 4.0 to tell if typeof(T) is dynamic? I want to be able to determine inside

2条回答
  •  暖寄归人
    2021-02-20 04:50

    You do this by checking if an instance is of type IDynamicMetaObjectProvider or you can check whether the type implements IDynamicMetaObjectProvider.

提交回复
热议问题