IConventionKey Interface

Definition

Represents a primary or alternate key on an entity.

This interface is used during model creation and allows the metadata to be modified. Once the model is built, IKey represents a read-only view of the same metadata.

public interface IConventionKey : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IKey
type IConventionKey = interface
    interface IConventionAnnotatable
    interface IAnnotatable
    interface IKey
Public Interface IConventionKey
Implements IConventionAnnotatable, IKey
Implements

Properties

Builder

Gets the builder that can be used to configure this key.

DeclaringEntityType

Gets the entity type the key is defined on. This may be different from the type that Properties are defined on when the key is defined a derived type in an inheritance hierarchy (since the properties may be defined on a base type).

Item[String]

Gets the value annotation with the given name, returning null if it does not exist.

(Inherited from IAnnotatable)
Properties

Gets the properties that make up the key.

Methods

AddAnnotation(String, Object, Boolean)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from IConventionAnnotatable)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from IConventionAnnotatable)
GetAnnotations()

Gets all annotations on the current object.

(Inherited from IConventionAnnotatable)
GetConfigurationSource()

Returns the configuration source for this key.

RemoveAnnotation(String)

Removes the annotation with the given name from this object.

(Inherited from IConventionAnnotatable)
SetAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from IConventionAnnotatable)

Extension Methods

AddAnnotations(IConventionAnnotatable, IEnumerable<IConventionAnnotation>, Boolean)

Adds annotations to an object.

GetAnnotation(IConventionAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

SetOrRemoveAnnotation(IConventionAnnotatable, String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

GetReferencingForeignKeys(IConventionKey)

Gets all foreign keys that target a given primary or alternate key.

AnnotationsToDebugString(IAnnotatable, Int32)

Gets the debug string for all annotations declared on the object.

GetAnnotation(IAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

GetKeyType(IKey)

Returns the type of the key property for simple keys, or an object array for composite keys.

GetPrincipalKeyValueFactory<TKey>(IKey)

Gets a factory for key values based on the index key values taken from various forms of entity data.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetReferencingForeignKeys(IKey)

Gets all foreign keys that target a given primary or alternate key.

IsPrimaryKey(IKey)

Returns a value indicating whether the key is the primary key.

ToDebugString(IKey, MetadataDebugStringOptions, Int32)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

FindSharedObjectRootKey(IConventionKey, StoreObjectIdentifier)

Finds the first IConventionKey that is mapped to the same constraint in a shared table-like object.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

FindSharedObjectRootKey(IKey, StoreObjectIdentifier)

Finds the first IKey that is mapped to the same constraint in a shared table-like object.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetDefaultName(IKey)

Returns the default key constraint name that would be used for this key.

GetDefaultName(IKey, StoreObjectIdentifier)

Returns the default key constraint name that would be used for this key for a particular table.

GetMappedConstraints(IKey)

Gets the unique constraints to which the key is mapped.

GetName(IKey)

Returns the key constraint name for this key.

GetName(IKey, StoreObjectIdentifier)

Returns the key constraint name for this key for a particular table.

GetNameConfigurationSource(IConventionKey)

Gets the ConfigurationSource for the constraint name.

SetName(IConventionKey, String, Boolean)

Sets the key constraint name for this key.

GetIsClusteredConfigurationSource(IConventionKey)

Gets the ConfigurationSource for whether the key is clustered.

IsClustered(IKey)

Returns a value indicating whether the key is clustered.

IsClustered(IKey, StoreObjectIdentifier)

Returns a value indicating whether the key is clustered.

SetIsClustered(IConventionKey, Nullable<Boolean>, Boolean)

Sets a value indicating whether the key is clustered.

Applies to