KeyBuilder<T> Class
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.
Provides a simple API for configuring a IMutableKey.
public class KeyBuilder<T> : Microsoft.EntityFrameworkCore.Metadata.Builders.KeyBuilder
type KeyBuilder<'T> = class
inherit KeyBuilder
Public Class KeyBuilder(Of T)
Inherits KeyBuilder
Type Parameters
- T
- Inheritance
Remarks
Instances of this class are returned from methods when using the ModelBuilder API and it is not designed to be directly constructed in your application code.
See Modeling entity types and relationships for more information and examples.
Constructors
KeyBuilder<T>(IMutableKey) |
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release. |
Properties
Metadata |
The key being configured. (Inherited from KeyBuilder) |
Methods
HasAnnotation(String, Object) |
Adds or updates an annotation on the key. If an annotation with the key specified in
|
Explicit Interface Implementations
IInfrastructure<IConventionKeyBuilder>.Instance |
The internal builder being used to configure the key. (Inherited from KeyBuilder) |
Extension Methods
HasName(KeyBuilder, String) |
Configures the name of the key constraint in the database when targeting a relational database. |
HasName<TEntity>(KeyBuilder<TEntity>, String) |
Configures the name of the key constraint in the database when targeting a relational database. |
HasFillFactor(KeyBuilder, Int32) |
Configures whether the key is created with fill factor option when targeting SQL Server. |
HasFillFactor<TEntity>(KeyBuilder<TEntity>, Int32) |
Configures whether the key is created with fill factor option when targeting SQL Server. |
IsClustered(KeyBuilder, Boolean) |
Configures whether the key is clustered when targeting SQL Server. |
IsClustered<TEntity>(KeyBuilder<TEntity>, Boolean) |
Configures whether the key is clustered when targeting SQL Server. |
Applies to
Entity Framework