IConventionEntityType.AddKey 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
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
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: