IConventionEntityType.AddKey Method

Definition

Overloads

AddKey(IConventionProperty, Boolean)

Adds a new alternate key to this entity type.

AddKey(IReadOnlyList<IConventionProperty>, Boolean)

Adds a new alternate key to this entity type.

AddKey(IConventionProperty, Boolean)

Adds a new alternate key to this entity type.

public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey? AddKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
abstract member AddKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
override this.AddKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Overridable Function AddKey (property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionKey

Parameters

property
IConventionProperty

The property to use as an alternate key.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created key.

Applies to

AddKey(IReadOnlyList<IConventionProperty>, Boolean)

Adds a new alternate key to this entity type.

public Microsoft.EntityFrameworkCore.Metadata.IConventionKey AddKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.IConventionKey? AddKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
abstract member AddKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Function AddKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionKey

Parameters

properties
IReadOnlyList<IConventionProperty>

The properties that make up the alternate key.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created key.

Applies to