答案 0 :(得分:0)
只是VB.Net中的答案?
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
<MetadataType(GetType(MovieMetaData))>
Partial Public Class Movie
End Class
Public Class MovieMetaData
<Required>
Public Property Title As Object
<Required>
<StringLength(5)>
Public Property Director As Object
<DisplayName("Date Released")>
<Required>
Public Property DateReleased As Object
End Class
(未经测试)