0

我正在寻找向我的“注册”类添加导航属性,以便可以访问父“人员”。

理想情况下,我可以添加Public Overrideable Property ParentPerson as Person,但我似乎无法让它工作,因为它抱怨关联的原则结束。

Public Class Person
    <Required()>
    Public Property ID As Integer

    <Required()>
    <StringLength(150)>
    Public Property Firstname As String

    <Required()>
    <StringLength(150)>
    Public Property Lastname As String

    Public Overridable Property Registration As Registration
End Class

Public Class Registration

    <Required()>
    Public Property ID As Integer 

    Public Property RegistrationDate As Date

    Public Overridable Property Sessions As List(Of RegistrationSession)

End Class
4

0 回答 0