Microsoft.EntityFrameworkCore Microsoft.EntityFrameworkCore Namespace

Classes

DbContext DbContext

A DbContext instance represents a session with the database and can be used to query and save instances of your entities. DbContext is a combination of the Unit Of Work and Repository patterns.

DbContextOptions DbContextOptions

The options to be used by a DbContext. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder to create instances of this class and it is not designed to be directly constructed in your application code.

DbContextOptions<TContext> DbContextOptions(Of TContext)

The options to be used by a DbContext. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder<TContext> to create instances of this class and it is not designed to be directly constructed in your application code.

DbContextOptionsBuilder DbContextOptionsBuilder

Provides a simple API surface for configuring DbContextOptions. Databases (and other extensions) typically define extension methods on this object that allow you to configure the database connection (and other options) to be used for a context.

You can use DbContextOptionsBuilder to configure a context by overriding OnConfiguring(DbContextOptionsBuilder) or creating a DbContextOptions externally and passing it to the context constructor.

DbContextOptionsBuilder<TContext> DbContextOptionsBuilder(Of TContext)

Provides a simple API surface for configuring DbContextOptions<TContext>. Databases (and other extensions) typically define extension methods on this object that allow you to configure the database connection (and other options) to be used for a context.

You can use DbContextOptionsBuilder to configure a context by overriding OnConfiguring(DbContextOptionsBuilder) or creating a DbContextOptions externally and passing it to the context constructor.

DbSet<TEntity> DbSet(Of TEntity)

A DbSet<TEntity> can be used to query and save instances of TEntity. LINQ queries against a DbSet<TEntity> will be translated into queries against the database.

The results of a LINQ query against a DbSet<TEntity> will contain the results returned from the database and may not reflect changes made in the context that have not been persisted to the database. For example, the results will not contain newly added entities and may still contain entities that are marked for deletion.

Depending on the database being used, some parts of a LINQ query against a DbSet<TEntity> may be evaluated in memory rather than being translated into a database query.

DbSet<TEntity> objects are usually obtained from a DbSet<TEntity> property on a derived DbContext or from the Set<TEntity>() method.

DbUpdateConcurrencyException DbUpdateConcurrencyException

An exception that is thrown when a concurrency violation is encountered while saving to the database. A concurrency violation occurs when an unexpected number of rows are affected during save. This is usually because the data in the database has been modified since it was loaded into memory.

DbUpdateException DbUpdateException

An exception that is thrown when an error is encountered while saving to the database.

EF EF

Static methods that are useful in application code where there is not an EF type for the method to be accessed from. For example, referencing a shadow state property in a LINQ query.

EntityFrameworkQueryableExtensions EntityFrameworkQueryableExtensions

Entity Framework LINQ related extension methods.

EntityTypeExtensions EntityTypeExtensions

Extension methods for IEntityType.

ExecutionStrategyExtensions ExecutionStrategyExtensions

Extension methods for IExecutionStrategy

InMemoryDbContextOptionsExtensions InMemoryDbContextOptionsExtensions

In-memory specific extension methods for DbContextOptionsBuilder.

KeyExtensions KeyExtensions

Extension methods for IKey.

ModelBuilder ModelBuilder

Provides a simple API surface for configuring a IMutableModel that defines the shape of your entities, the relationships between them, and how they map to the database.

You can use ModelBuilder to construct a model for a context by overriding OnModelCreating(ModelBuilder) on your derived context. Alternatively you can create the model externally and set it on a DbContextOptions instance that is passed to the context constructor.

ModelExtensions ModelExtensions

Extension methods for IModel.

MutableAnnotatableExtensions MutableAnnotatableExtensions

Extension methods for IMutableAnnotatable.

MutableEntityTypeExtensions MutableEntityTypeExtensions

Extension methods for IMutableEntityType.

MutableKeyExtensions MutableKeyExtensions

Extension methods for IMutableKey.

MutableModelExtensions MutableModelExtensions

Extension methods for IMutableModel.

MutableNavigationExtensions MutableNavigationExtensions

Extension methods for IMutableNavigation.

MutablePropertyBaseExtensions MutablePropertyBaseExtensions

Extension methods for IMutablePropertyBase.

MutablePropertyExtensions MutablePropertyExtensions

Extension methods for IMutableProperty.

NavigationExtensions NavigationExtensions

Extension methods for INavigation.

ObservableCollectionExtensions ObservableCollectionExtensions

Extension methods for .

PropertyBaseExtensions PropertyBaseExtensions

Extension methods for IPropertyBase.

PropertyExtensions PropertyExtensions

Extension methods for IProperty.

RelationalDatabaseFacadeExtensions RelationalDatabaseFacadeExtensions
RelationalEntityTypeBuilderExtensions RelationalEntityTypeBuilderExtensions

Relational database specific extension methods for EntityTypeBuilder.

RelationalIndexBuilderExtensions RelationalIndexBuilderExtensions

Relational database specific extension methods for IndexBuilder.

RelationalKeyBuilderExtensions RelationalKeyBuilderExtensions

Relational database specific extension methods for KeyBuilder.

RelationalMetadataExtensions RelationalMetadataExtensions

Relational database specific extension methods for metadata.

RelationalModelBuilderExtensions RelationalModelBuilderExtensions

Relational database specific extension methods for ModelBuilder.

RelationalPropertyBuilderExtensions RelationalPropertyBuilderExtensions

Relational database specific extension methods for PropertyBuilder.

RelationalQueryableExtensions RelationalQueryableExtensions

Relational database specific extension methods for LINQ queries.

RelationalReferenceCollectionBuilderExtensions RelationalReferenceCollectionBuilderExtensions

Relational database specific extension methods for ReferenceCollectionBuilder.

RelationalReferenceReferenceBuilderExtensions RelationalReferenceReferenceBuilderExtensions

Relational database specific extension methods for ReferenceReferenceBuilder.

SqlAzureExecutionStrategy SqlAzureExecutionStrategy
SqliteDbContextOptionsBuilderExtensions SqliteDbContextOptionsBuilderExtensions

SQLite specific extension methods for DbContextOptionsBuilder.

SqliteEntityTypeBuilderExtensions SqliteEntityTypeBuilderExtensions

SQLite specific extension methods for EntityTypeBuilder.

SqliteIndexBuilderExtensions SqliteIndexBuilderExtensions

SQLite specific extension methods for IndexBuilder.

SqliteKeyBuilderExtensions SqliteKeyBuilderExtensions

SQLite specific extension methods for KeyBuilder.

SqliteMetadataExtensions SqliteMetadataExtensions

SQLite specific extension methods for metadata.

SqlitePropertyBuilderExtensions SqlitePropertyBuilderExtensions

SQLite specific extension methods for PropertyBuilder.

SqliteReferenceCollectionBuilderExtensions SqliteReferenceCollectionBuilderExtensions

SQLite specific extension methods for ReferenceCollectionBuilder.

SqliteReferenceReferenceBuilderExtensions SqliteReferenceReferenceBuilderExtensions

SQLite specific extension methods for ReferenceReferenceBuilder.

SqlServerDbContextOptionsExtensions SqlServerDbContextOptionsExtensions

SQL Server specific extension methods for DbContextOptionsBuilder.

SqlServerEntityTypeBuilderExtensions SqlServerEntityTypeBuilderExtensions

SQL Server specific extension methods for EntityTypeBuilder.

SqlServerIndexBuilderExtensions SqlServerIndexBuilderExtensions

SQL Server specific extension methods for IndexBuilder.

SqlServerKeyBuilderExtensions SqlServerKeyBuilderExtensions

SQL Server specific extension methods for KeyBuilder.

SqlServerMetadataExtensions SqlServerMetadataExtensions

SQL Server specific extension methods for metadata.

SqlServerModelBuilderExtensions SqlServerModelBuilderExtensions

SQL Server specific extension methods for ModelBuilder.

SqlServerPropertyBuilderExtensions SqlServerPropertyBuilderExtensions

SQL Server specific extension methods for PropertyBuilder.

SqlServerReferenceCollectionBuilderExtensions SqlServerReferenceCollectionBuilderExtensions

SQL Server specific extension methods for ReferenceCollectionBuilder.

SqlServerReferenceReferenceBuilderExtensions SqlServerReferenceReferenceBuilderExtensions

SQL Server specific extension methods for ReferenceReferenceBuilder.

TypeBaseExtensions TypeBaseExtensions

Extension methods for ITypeBase.

WarningConfigurationBuilderExtensions WarningConfigurationBuilderExtensions

Relational database specific extension methods for WarningsConfigurationBuilder.

Enums

EntityState EntityState

The state in which an entity is being tracked by a context.

QueryTrackingBehavior QueryTrackingBehavior

Indicates how the results of a query are tracked by the ChangeTracker.

WarningBehavior WarningBehavior

The runtime behavior of warnings generated by Entity Framework