Delen via


OwnershipBuilder.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.OwnershipBuilder HasPrincipalKey (params string[] keyPropertyNames);
abstract member HasPrincipalKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder
override this.HasPrincipalKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder
Public Overridable Function HasPrincipalKey (ParamArray keyPropertyNames As String()) As OwnershipBuilder

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