MutableEntityTypeExtensions.GetOrAddKey Method

Definition

Overloads

GetOrAddKey(IMutableEntityType, IMutableProperty)

Gets the existing alternate key defined on a property, or creates a new one if one is not already defined.

GetOrAddKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)

Gets the existing alternate key defined on a set of properties, or creates a new one if one is not already defined.

GetOrAddKey(IMutableEntityType, IMutableProperty)

Gets the existing alternate key defined on a property, or creates a new one if one is not already defined.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrAddKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property);
static member GetOrAddKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * Microsoft.EntityFrameworkCore.Metadata.IMutableProperty -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrAddKey (entityType As IMutableEntityType, property As IMutableProperty) As IMutableKey

Parameters

entityType
IMutableEntityType

The entity type to get or create the alternate key on.

property
IMutableProperty

The property that is used as the alternate key.

Returns

The existing or newly created alternate key.

Applies to

GetOrAddKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)

Gets the existing alternate key defined on a set of properties, or creates a new one if one is not already defined.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrAddKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties);
static member GetOrAddKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrAddKey (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty)) As IMutableKey

Parameters

entityType
IMutableEntityType

The entity type to get or create the alternate key on.

properties
IReadOnlyList<IMutableProperty>

The properties that are used as the alternate key.

Returns

The existing or newly created alternate key.

Applies to