IConventionForeignKeyBuilder.HasNavigation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasNavigation(MemberInfo, Boolean, Boolean) |
Configures the given property as a navigation property used by this relationship. |
HasNavigation(String, Boolean, Boolean) |
Configures the property with the given name as a navigation property used by this relationship. |
HasNavigation(MemberInfo, Boolean, Boolean)
Configures the given property as a navigation property used by this relationship.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasNavigation (System.Reflection.MemberInfo property, bool pointsToPrincipal, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasNavigation (System.Reflection.MemberInfo? property, bool pointsToPrincipal, bool fromDataAnnotation = false);
abstract member HasNavigation : System.Reflection.MemberInfo * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasNavigation (property As MemberInfo, pointsToPrincipal As Boolean, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- property
- MemberInfo
The property to use.
- pointsToPrincipal
- Boolean
A value indicating whether the navigation is on the dependent type pointing to the principal type.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the navigation property was configured,
null
otherwise.
Applies to
HasNavigation(String, Boolean, Boolean)
Configures the property with the given name as a navigation property used by this relationship.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasNavigation (string name, bool pointsToPrincipal, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasNavigation (string? name, bool pointsToPrincipal, bool fromDataAnnotation = false);
abstract member HasNavigation : string * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasNavigation (name As String, pointsToPrincipal As Boolean, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- name
- String
The name of the property to use.
- pointsToPrincipal
- Boolean
A value indicating whether the navigation is on the dependent type pointing to the principal type.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the navigation property was configured,
null
otherwise.
Applies to
Entity Framework