Class PrimaryKeyDiscoveryConvention
- Namespace
- MongoDB.EntityFrameworkCore.Metadata.Conventions
- Assembly
- MongoDB.EntityFrameworkCore.dll
A convention that identifies the primary key for entity types based on the underlying element name being "_id".
public class PrimaryKeyDiscoveryConvention : KeyDiscoveryConvention, IEntityTypeAddedConvention, IPropertyAddedConvention, IKeyRemovedConvention, IEntityTypeBaseTypeChangedConvention, IEntityTypeMemberIgnoredConvention, IForeignKeyAddedConvention, IForeignKeyRemovedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyUniquenessChangedConvention, IForeignKeyOwnershipChangedConvention, ISkipNavigationForeignKeyChangedConvention, IConvention
- Inheritance
-
PrimaryKeyDiscoveryConvention
- Implements
- Inherited Members
Constructors
- PrimaryKeyDiscoveryConvention(ProviderConventionSetBuilderDependencies)
Creates a PrimaryKeyDiscoveryConvention.
Methods
- TryConfigurePrimaryKey(IConventionEntityTypeBuilder)
Discovers primary key candidates and configures the primary key if found.