IConventionForeignKeyBuilder.IsOwnership Method

Definition

Configures whether this relationship defines an ownership (i.e. whether the dependent entity must always be accessed via the navigation from the principal entity).

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder IsOwnership (bool? ownership, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? IsOwnership (bool? ownership, bool fromDataAnnotation = false);
abstract member IsOwnership : Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function IsOwnership (ownership As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

Parameters

ownership
Nullable<Boolean>

A value indicating whether this relationship defines an ownership. null to reset to default.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the ownership was configured, null otherwise.

Applies to