IConventionEntityType.SetPrimaryKey Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überlädt
SetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean) |
Legt den Primärschlüssel für diesen Entitätstyp fest. |
SetPrimaryKey(IConventionProperty, Boolean) |
Legt den Primärschlüssel für diesen Entitätstyp fest. |
SetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)
Legt den Primärschlüssel für diesen Entitätstyp fest.
public Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.IConventionKey? SetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member SetPrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Function SetPrimaryKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionKey
Parameter
- properties
- IReadOnlyList<IConventionProperty>
Die Eigenschaften, aus denen der Primärschlüssel besteht.
- fromDataAnnotation
- Boolean
Gibt an, ob die Konfiguration mithilfe einer Datenanmerkung angegeben wurde.
Gibt zurück
Der neu erstellte Schlüssel.
Gilt für:
SetPrimaryKey(IConventionProperty, Boolean)
Legt den Primärschlüssel für diesen Entitätstyp fest.
public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey? SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? property, bool fromDataAnnotation = false);
abstract member SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
override this.SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Overridable Function SetPrimaryKey (property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionKey
Parameter
- property
- IConventionProperty
Die Primärschlüsseleigenschaft.
- fromDataAnnotation
- Boolean
Gibt an, ob die Konfiguration mithilfe einer Datenanmerkung angegeben wurde.
Gibt zurück
Der neu erstellte Schlüssel.
Gilt für:
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für