Share via


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

Parameters

keyPropertyNames
String[]

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

Returns

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

Applies to