G
Guest
Hello,
I've got a simple shared property, e.g.
Public Class dbObject
Private Const m_ID As String = "ID"
Public Shared ReadOnly Property ID() As String
Get
Return m_ID
End Get
End Property
End Class
Rather than use the private variable m_ID, I'd rather just return the name
of the property as a string, e.g. return me.PropertyName, to save on code and
typos. But, "me" is not valid since this is not an instance (it's shared),
and I can't figure out the syntax to do what I know is possible via
reflection. Any thoughts on how to get a string for the name of a shared
property within the get accessor?
Thanks,
Bill
I've got a simple shared property, e.g.
Public Class dbObject
Private Const m_ID As String = "ID"
Public Shared ReadOnly Property ID() As String
Get
Return m_ID
End Get
End Property
End Class
Rather than use the private variable m_ID, I'd rather just return the name
of the property as a string, e.g. return me.PropertyName, to save on code and
typos. But, "me" is not valid since this is not an instance (it's shared),
and I can't figure out the syntax to do what I know is possible via
reflection. Any thoughts on how to get a string for the name of a shared
property within the get accessor?
Thanks,
Bill