MutableEntityTypeExtensions.GetOrSetPrimaryKey Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetOrSetPrimaryKey(IMutableEntityType, IMutableProperty) |
Gets the existing primary key of an entity, or sets it if one is not defined. |
GetOrSetPrimaryKey(IMutableEntityType, IReadOnlyList<IMutableProperty>) |
Gets the existing primary key of an entity, or sets it if one is not defined. |
GetOrSetPrimaryKey(IMutableEntityType, IMutableProperty)
Gets the existing primary key of an entity, or sets it if one is not defined.
public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrSetPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property);
static member GetOrSetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * Microsoft.EntityFrameworkCore.Metadata.IMutableProperty -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrSetPrimaryKey (entityType As IMutableEntityType, property As IMutableProperty) As IMutableKey
Parameters
- entityType
- IMutableEntityType
The entity type to get or set the key on.
- property
- IMutableProperty
The property to set as the primary key if one is not already defined.
Returns
The existing or newly created key.
Applies to
GetOrSetPrimaryKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)
Gets the existing primary key of an entity, or sets it if one is not defined.
public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrSetPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties);
static member GetOrSetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrSetPrimaryKey (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty)) As IMutableKey
Parameters
- entityType
- IMutableEntityType
The entity type to get or set the key on.
- properties
- IReadOnlyList<IMutableProperty>
The properties to set as the primary key if one is not already defined.
Returns
The existing or newly created key.
Applies to
Entity Framework