Just use .Name
; PropertyInfo
doesn't define this - it inherits it from MemberInfo
Marc Gravell
2009-04-09 13:45:10
Just use .Name
; PropertyInfo
doesn't define this - it inherits it from MemberInfo
You can access this property via property.Name.
The fact that the debugger shows base.Name is a bit of a misnomer. In reality the C# EE is evaluating property.Name under the hood. It does not actually evaluate "base.Name".
This is true regardless of whether or not the property / method is virtual. The reason being that the CLR deubgger provides no means by which the EE can invoke a virtual method in a non-virtual method. There are ways to call a method via relfection to achieve this effect but neither C# or VB.Net go this route in their respective EE's.