Il s'agit d'une configuration de base si vous souhaitez que les conventions par défaut prennent en charge le mappage. Mais vous pouvez utiliser l'interface fluide et définir quoi que ce soit à partir de ces exemples comme relation valide:
propriété Navigation uniquement sur le parent:
Public Class Foo
'PK
Public Property FooID As Integer
'Navigation Prop
Public Overridable Property Bars As ICollection(Of Bar)
End Class
Public Class Bar
'PK
Public Property BarID As Integer
End Class
Navigation propety uniquement sur le parent et la propriété FK sur l'enfant:
Public Class Foo
'PK
Public Property FooID As Integer
'Navigation Prop
Public Overridable Property Bars As ICollection(Of Bar)
End Class
Public Class Bar
'PK
Public Property BarID As Integer
'FK
Public
Property FooID As Integer
End Class
Navigation sur la propriété de l'enfant:
Public Class Foo
'PK
Public Property FooID As Integer
End Class
Public Class Bar
'PK
Public Property BarID As Integer
'Navigation Prop
Public Overridable Property Foo As Foo
End Class
Propriété de navigation et propriété FK sur l'enfant:
Public Class Foo
'PK
Public Property FooID As Integer
End Class
Public Class Bar
'PK
Public Property BarID As Integer
'FK
Public Property FooID As Integer
'Navigation Prop
Public Overridable Property Foo As Foo
End Class
De plus, vous pouvez également faire en sorte que la realtion soit facultative.