IConventionEntityTypeBuilder.CanSetPrimaryKey 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
CanSetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean) |
Returns a value indicating whether the given properties can be set as the primary key for this entity type. |
CanSetPrimaryKey(IReadOnlyList<String>, Boolean) |
Returns a value indicating whether the given properties can be set as the primary key for this entity type. |
CanSetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)
Returns a value indicating whether the given properties can be set as the primary key for this entity type.
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member CanSetPrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> bool
Public Function CanSetPrimaryKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As Boolean
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
true
if the given properties can be set as the primary key.
Applies to
CanSetPrimaryKey(IReadOnlyList<String>, Boolean)
Returns a value indicating whether the given properties can be set as the primary key for this entity type.
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member CanSetPrimaryKey : System.Collections.Generic.IReadOnlyList<string> * bool -> bool
Public Function CanSetPrimaryKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As Boolean
Parameters
- propertyNames
- IReadOnlyList<String>
The names of the properties that make up the index.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
true
if the given properties can be set as the primary key.
Applies to
Entity Framework