Microsoft.EntityFrameworkCore.Metadata Namespace

Classes

RelationalAnnotationNames

Names for well-known relational model annotations. Applications should not use these names directly, but should instead use the 'Relational()' methods on RelationalMetadataExtensions. They are exposed here for use by database providers and conventions.

RelationalAnnotations

Base class for helpers that can handle setting annotations when used with conventions that may or may not be able to override an annotation that has already been set.

RelationalEntityTypeAnnotations

Properties for relational-specific annotations accessed through Relational(IMutableEntityType).

RelationalForeignKeyAnnotations

Properties for relational-specific annotations accessed through Relational(IMutableForeignKey).

RelationalIndexAnnotations

Properties for relational-specific annotations accessed through Relational(IMutableIndex).

RelationalKeyAnnotations

Properties for relational-specific annotations accessed through Relational(IMutableKey).

RelationalModelAnnotations

Properties for relational-specific annotations accessed through Relational(IMutableModel).

RelationalPropertyAnnotations

Properties for relational-specific annotations accessed through Relational(IMutableProperty).

RelationalPropertyExtensions

Extension methods for IProperty for relational database metadata.

RelationalSequenceBuilder
ScaffoldingMetadataExtensions
Sequence
SequenceBuilder

A fluent API builder for ISequence objects.

SimpleModelFactory

Creates instances of IMutableModel that have no conventions. This is useful when Exhaustively configuring a model based on some existing metadata.

This is typically not used in application code since building a model by overriding OnModelCreating(ModelBuilder) or using ModelBuilder directly is much easier.

SqlServerAnnotationProvider
SqlServerEntityTypeAnnotations

Properties for relational-specific annotations accessed through SqlServer(IMutableEntityType).

SqlServerIndexAnnotations

Properties for relational-specific annotations accessed through SqlServer(IMutableIndex).

SqlServerKeyAnnotations

Properties for relational-specific annotations accessed through SqlServer(IMutableKey).

SqlServerModelAnnotations

Properties for relational-specific annotations accessed through SqlServer(IMutableModel).

SqlServerPropertyAnnotations

Properties for SQL Server-specific annotations accessed through SqlServer(IMutableProperty).

Interfaces

IDbFunction

Represents a relational database function in an IModel.

IEntityType

Represents an entity type in an IModel.

IForeignKey

Represents a relationship where a foreign key property(s) in a dependent entity type reference a corresponding primary or alternate key in a principal entity type.

IIndex

Represents an index on a set of properties.

IKey

Represents a primary or alternate key on an entity.

IModel

Metadata about the shape of entities, the relationships between them, and how they map to the database. A model is typically created by overriding the OnConfiguring(DbContextOptionsBuilder) method on a derived context, or using ModelBuilder.

IMutableAnnotatable

A class that exposes annotations that can be modified. Annotations allow for arbitrary metadata to be stored on an object.

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

IMutableDbFunction

Represents a relational database function in an IMutableModel in the a form that can be mutated while the model is being built.

IMutableEntityType

Represents an entity in an IMutableModel.

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

IMutableForeignKey

Represents a relationship where a foreign key property(s) in a dependent entity type reference a corresponding primary or alternate key in a principal entity type.

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

IMutableIndex

Represents an index on a set of properties.

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

IMutableKey

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 ready-only view of the same metadata.

IMutableModel

Metadata about the shape of entities, the relationships between them, and how they map to the database. A model is typically created by overriding the OnConfiguring(DbContextOptionsBuilder) method on a derived context, or using ModelBuilder.

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

IMutableNavigation

Represents a navigation property which can be used to navigate a relationship.

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

IMutableProperty

Represents a scalar property of an entity.

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

IMutablePropertyBase

Base type for navigation and scalar properties.

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

IMutableSequence

Represents a database sequence in the IMutableModel in a form that can be mutated while building the model.

IMutableServiceProperty

A IPropertyBase in the Entity Framework model that represents an injected service from the DbContext.

IMutableTypeBase

Represents a type in an IMutableModel.

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

INavigation

Represents a navigation property which can be used to navigate a relationship.

IProperty

Represents a scalar property of an entity.

IPropertyBase

Base type for navigation and scalar properties.

IRelationalAnnotationProvider
IRelationalEntityTypeAnnotations

Properties for relational-specific annotations accessed through Relational(IEntityType).

IRelationalForeignKeyAnnotations

Properties for relational-specific annotations accessed through Relational(IForeignKey).

IRelationalIndexAnnotations

Properties for relational-specific annotations accessed through Relational(IIndex).

IRelationalKeyAnnotations

Properties for relational-specific annotations accessed through Relational(IKey).

IRelationalModelAnnotations

API for relational-specific annotations accessed through Relational(IModel).

IRelationalPropertyAnnotations

Properties for relational-specific annotations accessed through Relational(IProperty).

ISequence

Represents a database sequence in the IModel.

IServiceProperty

A IPropertyBase in the Entity Framework model that represents an injected service from the DbContext.

ISqlServerEntityTypeAnnotations

Properties for relational-specific annotations accessed through SqlServer(IEntityType).

ISqlServerIndexAnnotations

Properties for relational-specific annotations accessed through SqlServer(IIndex).

ISqlServerKeyAnnotations

Properties for relational-specific annotations accessed through SqlServer(IKey).

ISqlServerModelAnnotations

API for SQL Server-specific annotations accessed through SqlServer(IModel).

ISqlServerPropertyAnnotations

API for SQL Server-specific annotations accessed through SqlServer(IProperty).

ITypeBase

Represents a type in an IModel.

Enums

ChangeTrackingStrategy

Indicates how the context detects changes to properties for an instance of the entity type.

DeleteBehavior

Indicates how a delete operation is applied to dependent entities in a relationship when the principal is deleted or the relationship is severed.

PropertyAccessMode

Pass a value from this enum to UsePropertyAccessMode(PropertyAccessMode), UsePropertyAccessMode(PropertyAccessMode), or UsePropertyAccessMode(PropertyAccessMode) to change whether the property or backing field will be used when reading and writing to a property or field.

If no access mode is set, then the backing field for a property will be used if possible when constructing new instances of the entity. The property getter or setter will be used, if possible, for all other accesses of the property. Note that when it is not possible to use the field because it could not be found by convention and was not specified using HasField(String), then the property will be used instead. Likewise, when it is not possible to use the property getter or setter, for example when the property is read-only, then the field will be used instead.

PropertySaveBehavior

Indicates how changes to the value of a property will be handled by Entity Framework change tracking which in turn will determine whether the value set is sent to the database or not. Used with BeforeSaveBehavior and AfterSaveBehavior

SqlServerValueGenerationStrategy

Defines two strategies to use across the EF Core stack when generating key values from SQL Server database columns.

ValueGenerated

Indicates when a value for a property will be generated by the database.

Even when a property is set to be generated by the database, EF may still attempt to save a specific value (rather than having one generated by the database) when an entity is added and a value is assigned, or the property is marked as modified for an existing entity. See PropertySaveBehavior for more details.