IConventionEntityTypeBuilder.HasOwnership 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
HasOwnership(IConventionEntityType, MemberInfo, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(IConventionEntityType, String, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(IConventionEntityType, MemberInfo, MemberInfo, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(IConventionEntityType, String, String, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(Type, MemberInfo, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(Type, String, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(Type, MemberInfo, MemberInfo, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(Type, String, String, Boolean) |
Configures a relationship where the target entity is owned by (or part of) this entity. |
HasOwnership(IConventionEntityType, MemberInfo, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType targetEntityType, System.Reflection.MemberInfo navigation, bool fromDataAnnotation = false);
abstract member HasOwnership : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As IConventionEntityType, navigation As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- IConventionEntityType
The entity type that this relationship targets.
- navigation
- MemberInfo
The navigation property on this entity type that is part of the relationship.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship if it exists on the entity type,
null
otherwise.
Applies to
HasOwnership(IConventionEntityType, String, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType targetEntityType, string navigationName, bool fromDataAnnotation = false);
abstract member HasOwnership : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As IConventionEntityType, navigationName As String, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- IConventionEntityType
The entity type that this relationship targets.
- navigationName
- String
The name of the navigation property on this entity type that is part of the relationship.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship.
Applies to
HasOwnership(IConventionEntityType, MemberInfo, MemberInfo, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType targetEntityType, System.Reflection.MemberInfo navigation, System.Reflection.MemberInfo? inverseNavigation, bool fromDataAnnotation = false);
abstract member HasOwnership : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * System.Reflection.MemberInfo * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As IConventionEntityType, navigation As MemberInfo, inverseNavigation As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- IConventionEntityType
The entity type that this relationship targets.
- navigation
- MemberInfo
The navigation property on this entity type that is part of the relationship.
- inverseNavigation
- MemberInfo
The navigation property on the target entity type that is part of the relationship. If null
is specified, the relationship will be configured without a navigation property on the target end.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship if it exists on the entity type,
null
otherwise.
Applies to
HasOwnership(IConventionEntityType, String, String, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType targetEntityType, string navigationName, string? inverseNavigationName, bool fromDataAnnotation = false);
abstract member HasOwnership : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * string * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As IConventionEntityType, navigationName As String, inverseNavigationName As String, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- IConventionEntityType
The entity type that this relationship targets.
- navigationName
- String
The name of the navigation property on this entity type that is part of the relationship.
- inverseNavigationName
- String
The name of the navigation property on the target entity type that is part of the relationship. If null
is specified, the relationship will be configured without a navigation property on the target end.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship if it exists on the entity type,
null
otherwise.
Applies to
HasOwnership(Type, MemberInfo, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder HasOwnership (Type targetEntityType, System.Reflection.MemberInfo navigationToTarget, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasOwnership (Type targetEntityType, System.Reflection.MemberInfo navigation, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Type targetEntityType, System.Reflection.MemberInfo navigation, bool fromDataAnnotation = false);
abstract member HasOwnership : Type * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
abstract member HasOwnership : Type * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As Type, navigationToTarget As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder
Public Function HasOwnership (targetEntityType As Type, navigation As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- Type
The type that this relationship targets.
- navigationToTargetnavigation
- MemberInfo
The navigation property on this entity type that is part of the relationship.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship if it exists on the entity type,
null
otherwise.
Applies to
HasOwnership(Type, String, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder HasOwnership (Type targetEntityType, string navigationToTargetName, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasOwnership (Type targetEntityType, string navigationName, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Type targetEntityType, string navigationName, bool fromDataAnnotation = false);
abstract member HasOwnership : Type * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
abstract member HasOwnership : Type * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As Type, navigationToTargetName As String, Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder
Public Function HasOwnership (targetEntityType As Type, navigationName As String, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- Type
The type that this relationship targets.
- navigationToTargetNamenavigationName
- String
The name of the navigation property on this entity type that is part of the relationship.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship.
Applies to
HasOwnership(Type, MemberInfo, MemberInfo, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder HasOwnership (Type targetEntityType, System.Reflection.MemberInfo navigationToTarget, System.Reflection.MemberInfo inverseNavigation, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasOwnership (Type targetEntityType, System.Reflection.MemberInfo navigation, System.Reflection.MemberInfo inverseNavigation, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Type targetEntityType, System.Reflection.MemberInfo navigation, System.Reflection.MemberInfo? inverseNavigation, bool fromDataAnnotation = false);
abstract member HasOwnership : Type * System.Reflection.MemberInfo * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
abstract member HasOwnership : Type * System.Reflection.MemberInfo * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As Type, navigationToTarget As MemberInfo, inverseNavigation As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder
Public Function HasOwnership (targetEntityType As Type, navigation As MemberInfo, inverseNavigation As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- Type
The type that this relationship targets.
- navigationToTargetnavigation
- MemberInfo
The navigation property on this entity type that is part of the relationship.
- inverseNavigation
- MemberInfo
The navigation property on the target entity type that is part of the relationship. If null
is specified, the relationship will be configured without a navigation property on the target end.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship if it exists on the entity type,
null
otherwise.
Applies to
HasOwnership(Type, String, String, Boolean)
Configures a relationship where the target entity is owned by (or part of) this entity.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder HasOwnership (Type targetEntityType, string navigationToTargetName, string inverseNavigationName, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasOwnership (Type targetEntityType, string navigationName, string inverseNavigationName, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasOwnership (Type targetEntityType, string navigationName, string? inverseNavigationName, bool fromDataAnnotation = false);
abstract member HasOwnership : Type * string * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
abstract member HasOwnership : Type * string * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasOwnership (targetEntityType As Type, navigationToTargetName As String, inverseNavigationName As String, Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder
Public Function HasOwnership (targetEntityType As Type, navigationName As String, inverseNavigationName As String, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder
Parameters
- targetEntityType
- Type
The type that this relationship targets.
- navigationToTargetNamenavigationName
- String
The name of the navigation property on this entity type that is part of the relationship.
- inverseNavigationName
- String
The name of the navigation property on the target entity type that is part of the relationship. If null
is specified, the relationship will be configured without a navigation property on the target end.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the relationship if it exists on the entity type,
null
otherwise.
Applies to
Entity Framework