CollectionOwnershipBuilder.HasPrincipalKey(String[]) Method

Definition

Configures the unique property(s) that this relationship targets. Typically you would only call this method if you want to use a property(s) other than the primary key as the principal property(s). If the specified property(s) is not already a unique constraint (or the primary key) then a new unique constraint will be introduced.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder HasPrincipalKey (params string[] keyPropertyNames);
abstract member HasPrincipalKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder
override this.HasPrincipalKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder
Public Overridable Function HasPrincipalKey (ParamArray keyPropertyNames As String()) As CollectionOwnershipBuilder

Parameters

keyPropertyNames
String[]

The name(s) of the reference key property(s).

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to