IConventionEntityTypeBuilder.PrimaryKey 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
PrimaryKey(IReadOnlyList<IConventionProperty>, Boolean) |
Sets the properties that make up the primary key for this entity type. |
PrimaryKey(IReadOnlyList<String>, Boolean) |
Sets the properties that make up the primary key for this entity type. |
PrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)
Sets the properties that make up the primary key for this entity type.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder PrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder? PrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member PrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder
Public Function PrimaryKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionKeyBuilder
Parameters
- properties
- IReadOnlyList<IConventionProperty>
The properties that make up the primary key.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the primary key.
Applies to
PrimaryKey(IReadOnlyList<String>, Boolean)
Sets the properties that make up the primary key for this entity type.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder? PrimaryKey (System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);
abstract member PrimaryKey : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder
Public Function PrimaryKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionKeyBuilder
Parameters
- propertyNames
- IReadOnlyList<String>
The names of the properties that make up the primary key.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the primary key.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för