Get class that method was defined in?
Given a MethodInfo
obje开发者_运维问答ct, how can I get the Type
object for the class that it was defined in?
You're looking for the DeclaringType
property:
Gets the class that declares this member.
Oh... I think it's DeclaringType.
You can get the Type the method belongs to with the DeclaringType property
精彩评论