views:

35

answers:

1

I am getting the members of a dynamic class using the following method:

public static IEnumerable<string> GetDynamicMemberNames(this IDynamicMetaObjectProvider dynamicProvider)
{
  DynamicMetaObject metaObject = dynamicProvider.GetMetaObject(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

+1  A: 

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.

Jon Skeet