.NET 4.0 dynamic - Getting more information about members returned from GetDynamicMemberNames
I am getting the members of a dynamic class using the following method:
public static IEnumerable<string> GetDynamicMemberNames(this IDynamicMetaObjectProvider dynamicProvider)
{
DynamicMetaObject metaObject = dynamicProvider.GetM开发者_运维技巧etaObject(Expression.Constant(dynamicProvider));
return metaObject.GetDynamicMemberNames();
}
How can I now get more information about what the members are? e.g. whether the member is a property or a method, property return types, etc
You can't, I'm afraid. That's all the information which is exposed. In some cases, the same member name could work as both a property and a method - for example, it could return a delegate if you fetch it as a property, but execute the same code if you call it as a method.
精彩评论