我有以下模型:
Public Class MyModel
Public Property MyModelId As Integer
Public Property Description As String
Public Property AnotherProperty As String
End Class
有没有一种方法可以将模型的属性名称作为字符串表示形式获取,如下面的代码?
Dim propertyName as String = GetPropertyNameAsStringMethod(MyModel.Description)
所以 propertyName 变量的值是“描述”。