Table of Contents

Class RelationalEventId

Namespace
Microsoft.EntityFrameworkCore.Diagnostics
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Event IDs for relational events that correspond to messages logged to an ILogger and events sent to a DiagnosticSource.

public static class RelationalEventId
Inheritance
RelationalEventId
Inherited Members

Remarks

These IDs are also used with Microsoft.EntityFrameworkCore.Diagnostics.WarningsConfigurationBuilder to configure the behavior of warnings.

See Logging, events, and diagnostics for more information and examples.

Fields

AllIndexPropertiesNotToMappedToAnyTable

An index specifies properties all of which are not mapped to a column in any table.

public static readonly EventId AllIndexPropertiesNotToMappedToAnyTable

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the IndexEventData payload when used with a DiagnosticSource.

AmbientTransactionEnlisted

Entity Framework enlisted the connection in an ambient transaction.

public static readonly EventId AmbientTransactionEnlisted

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEnlistedEventData payload when used with a DiagnosticSource.

AmbientTransactionWarning

An application may have expected an ambient transaction to be used when it was actually ignored.

public static readonly EventId AmbientTransactionWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the ConnectionEventData payload when used with a DiagnosticSource.

BatchExecutorFailedToReleaseSavepoint

An error occurred while the batch executor was releasing a transaction savepoint.

public static readonly EventId BatchExecutorFailedToReleaseSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Update category.

BatchExecutorFailedToRollbackToSavepoint

An error occurred while the batch executor was rolling back the transaction to a savepoint, after an exception occured.

public static readonly EventId BatchExecutorFailedToRollbackToSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Update category.

BatchReadyForExecution

Update commands were batched and are now ready for execution MinBatchSize(int).

public static readonly EventId BatchReadyForExecution

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Update category.

This event uses the BatchEventData payload when used with a DiagnosticSource.

BatchSmallerThanMinBatchSize

Update commands were not batched because there were fewer than MinBatchSize(int).

public static readonly EventId BatchSmallerThanMinBatchSize

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Update category.

This event uses the MinBatchSizeEventData payload when used with a DiagnosticSource.

BoolWithDefaultWarning

A bool property is configured with a store-generated default.

public static readonly EventId BoolWithDefaultWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.PropertyEventData payload when used with a DiagnosticSource.

ColumnOrderIgnoredWarning

Column order was ignored.

public static readonly EventId ColumnOrderIgnoredWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationColumnOperationEventData payload when used with a DiagnosticSource.

CommandCanceled

A DbCommand has been canceled.

public static readonly EventId CommandCanceled

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandEndEventData payload when used with a DiagnosticSource.

CommandCreated

A DbCommand has been created.

public static readonly EventId CommandCreated

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandEndEventData payload when used with a DiagnosticSource.

CommandCreating

A DbCommand is being created.

public static readonly EventId CommandCreating

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandCorrelatedEventData payload when used with a DiagnosticSource.

CommandError

An error occurred while a database command was executing.

public static readonly EventId CommandError

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandErrorEventData payload when used with a DiagnosticSource.

CommandExecuted

A database command has been executed.

public static readonly EventId CommandExecuted

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandExecutedEventData payload when used with a DiagnosticSource.

CommandExecuting

A database command is executing.

public static readonly EventId CommandExecuting

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandEventData payload when used with a DiagnosticSource.

CommandInitialized

A DbCommand has been initialized with command text and other parameters.

public static readonly EventId CommandInitialized

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the CommandEndEventData payload when used with a DiagnosticSource.

ConnectionClosed

A database connection has been closed.

public static readonly EventId ConnectionClosed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionEndEventData payload when used with a DiagnosticSource.

ConnectionClosing

A database connection is closing.

public static readonly EventId ConnectionClosing

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionEventData payload when used with a DiagnosticSource.

ConnectionCreated

A DbConnection has been created by EF.

public static readonly EventId ConnectionCreated

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionCreatedEventData payload when used with a DiagnosticSource.

ConnectionCreating

A DbConnection is about to be created by EF.

public static readonly EventId ConnectionCreating

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionCreatingEventData payload when used with a DiagnosticSource.

ConnectionDisposed

A database connection has been disposed. This event is only triggered when Entity Framework is responsible for disposing the connection.

public static readonly EventId ConnectionDisposed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionEndEventData payload when used with a DiagnosticSource.

ConnectionDisposing

A database connection is going to be disposed. This event is only triggered when Entity Framework is responsible for disposing the connection.

public static readonly EventId ConnectionDisposing

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionEventData payload when used with a DiagnosticSource.

ConnectionError

A error occurred while opening or using a database connection.

public static readonly EventId ConnectionError

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionErrorEventData payload when used with a DiagnosticSource.

ConnectionOpened

A database connection has been opened.

public static readonly EventId ConnectionOpened

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionEndEventData payload when used with a DiagnosticSource.

ConnectionOpening

A database connection is opening.

public static readonly EventId ConnectionOpening

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection category.

This event uses the ConnectionEventData payload when used with a DiagnosticSource.

CreatedTransactionSavepoint

A database transaction savepoint has been created.

public static readonly EventId CreatedTransactionSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEndEventData payload when used with a DiagnosticSource.

CreatingTransactionSavepoint

A database transaction savepoint is being created.

public static readonly EventId CreatingTransactionSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

DataReaderClosing

A database data reader is about to be closed.

public static readonly EventId DataReaderClosing

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the DataReaderClosingEventData payload when used with a DiagnosticSource.

DataReaderDisposing

A database data reader has been disposed.

public static readonly EventId DataReaderDisposing

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command category.

This event uses the DataReaderDisposingEventData payload when used with a DiagnosticSource.

DuplicateColumnOrders

The configured column orders for a table contains duplicates.

public static readonly EventId DuplicateColumnOrders

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the ColumnsEventData payload when used with a DiagnosticSource.

ExecuteDeleteFailed

An error occurred while executing an 'ExecuteDelete' operation.

public static readonly EventId ExecuteDeleteFailed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Query category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.DbContextTypeErrorEventData payload when used with a DiagnosticSource.

ExecuteUpdateFailed

An error occurred while executing an 'ExecuteUpdate' operation.

public static readonly EventId ExecuteUpdateFailed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Query category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.DbContextTypeErrorEventData payload when used with a DiagnosticSource.

ExplicitTransactionEnlisted

The connection was explicitly enlisted in a transaction.

public static readonly EventId ExplicitTransactionEnlisted

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEnlistedEventData payload when used with a DiagnosticSource.

ForeignKeyPropertiesMappedToUnrelatedTables

A foreign key specifies properties which don't map to the related tables.

public static readonly EventId ForeignKeyPropertiesMappedToUnrelatedTables

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.ForeignKeyEventData payload when used with a DiagnosticSource.

ForeignKeyTpcPrincipalWarning

A foreign key specifies properties which don't map to the related tables.

public static readonly EventId ForeignKeyTpcPrincipalWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.ForeignKeyEventData payload when used with a DiagnosticSource.

IndexPropertiesBothMappedAndNotMappedToTable

An index specifies properties some of which are mapped and some of which are not mapped to a column in a table.

public static readonly EventId IndexPropertiesBothMappedAndNotMappedToTable

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the IndexWithPropertyEventData payload when used with a DiagnosticSource.

IndexPropertiesMappedToNonOverlappingTables

An index specifies properties which map to columns on non-overlapping tables.

public static readonly EventId IndexPropertiesMappedToNonOverlappingTables

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the IndexWithPropertiesEventData payload when used with a DiagnosticSource.

KeyPropertiesNotMappedToTable

A key specifies properties which don't map to a single table.

public static readonly EventId KeyPropertiesNotMappedToTable

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.KeyEventData payload when used with a DiagnosticSource.

MigrateUsingConnection

Migrations is using a database connection.

public static readonly EventId MigrateUsingConnection

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigratorConnectionEventData payload when used with a DiagnosticSource.

MigrationApplying

A migration is being applied.

public static readonly EventId MigrationApplying

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationEventData payload when used with a DiagnosticSource.

MigrationAttributeMissingWarning

A MigrationAttribute isn't specified on the class.

public static readonly EventId MigrationAttributeMissingWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationTypeEventData payload when used with a DiagnosticSource.

MigrationGeneratingDownScript

Migrations is generating a "down" script.

public static readonly EventId MigrationGeneratingDownScript

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationScriptingEventData payload when used with a DiagnosticSource.

MigrationGeneratingUpScript

Migrations is generating an "up" script.

public static readonly EventId MigrationGeneratingUpScript

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationScriptingEventData payload when used with a DiagnosticSource.

MigrationReverting

A migration is being reverted.

public static readonly EventId MigrationReverting

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationEventData payload when used with a DiagnosticSource.

MigrationsNotApplied

Migrations weren't applied.

public static readonly EventId MigrationsNotApplied

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigratorEventData payload when used with a DiagnosticSource.

MigrationsNotFound

Migrations weren't found.

public static readonly EventId MigrationsNotFound

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Migrations category.

This event uses the MigrationAssemblyEventData payload when used with a DiagnosticSource.

ModelValidationKeyDefaultValueWarning

A single database default column value has been set on a key column.

public static readonly EventId ModelValidationKeyDefaultValueWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.PropertyEventData payload when used with a DiagnosticSource.

MultipleCollectionIncludeWarning

A query is loading multiple related collections without configuring a QuerySplittingBehavior.

public static readonly EventId MultipleCollectionIncludeWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Query category.

NonQueryOperationFailed

An error occurred while executing a non-query operation.

public static readonly EventId NonQueryOperationFailed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Query category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.DbContextTypeErrorEventData payload when used with a DiagnosticSource.

OptionalDependentWithAllNullPropertiesWarning

The entity does not have any property with a non-default value to identify whether the entity exists.

public static readonly EventId OptionalDependentWithAllNullPropertiesWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Update category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.UpdateEntryEventData payload when used with a DiagnosticSource.

OptionalDependentWithoutIdentifyingPropertyWarning

The entity does not have any property with a non-default value to identify whether the entity exists.

public static readonly EventId OptionalDependentWithoutIdentifyingPropertyWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.EntityTypeEventData payload when used with a DiagnosticSource.

QueryPossibleUnintendedUseOfEqualsWarning

A query is using equals comparisons in a possibly unintended way.

public static readonly EventId QueryPossibleUnintendedUseOfEqualsWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Query category.

This event uses the TwoSqlExpressionsEventData payload when used with a DiagnosticSource.

ReleasedTransactionSavepoint

A database transaction savepoint has been released.

public static readonly EventId ReleasedTransactionSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEndEventData payload when used with a DiagnosticSource.

ReleasingTransactionSavepoint

A database transaction savepoint is being released.

public static readonly EventId ReleasingTransactionSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

RolledBackToTransactionSavepoint

A database transaction has been rolled back to a savepoint.

public static readonly EventId RolledBackToTransactionSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEndEventData payload when used with a DiagnosticSource.

RollingBackToTransactionSavepoint

A database transaction is being rolled back to a savepoint.

public static readonly EventId RollingBackToTransactionSavepoint

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

StoredProcedureConcurrencyTokenNotMapped

An entity type is mapped to the stored procedure with a concurrency token not mapped to any original value parameter.

public static readonly EventId StoredProcedureConcurrencyTokenNotMapped

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.StoredProcedurePropertyEventData payload when used with a DiagnosticSource.

TpcStoreGeneratedIdentityWarning

The PK is using store-generated values in TPC.

public static readonly EventId TpcStoreGeneratedIdentityWarning

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation category.

This event uses the Microsoft.EntityFrameworkCore.Diagnostics.PropertyEventData payload when used with a DiagnosticSource.

TransactionCommitted

A database transaction has been committed.

public static readonly EventId TransactionCommitted

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEndEventData payload when used with a DiagnosticSource.

TransactionCommitting

A database transaction is being committed.

public static readonly EventId TransactionCommitting

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

TransactionDisposed

A database transaction has been disposed.

public static readonly EventId TransactionDisposed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

TransactionError

An error has occurred while using. committing, or rolling back a database transaction.

public static readonly EventId TransactionError

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionErrorEventData payload when used with a DiagnosticSource.

TransactionRolledBack

A database transaction has been rolled back.

public static readonly EventId TransactionRolledBack

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEndEventData payload when used with a DiagnosticSource.

TransactionRollingBack

A database transaction is being rolled back.

public static readonly EventId TransactionRollingBack

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

TransactionStarted

A database transaction has been started.

public static readonly EventId TransactionStarted

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEndEventData payload when used with a DiagnosticSource.

TransactionStarting

A database transaction is starting.

public static readonly EventId TransactionStarting

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionStartingEventData payload when used with a DiagnosticSource.

TransactionUsed

Entity Framework started using an already existing database transaction.

public static readonly EventId TransactionUsed

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction category.

This event uses the TransactionEventData payload when used with a DiagnosticSource.

UnexpectedTrailingResultSetWhenSaving

An unexpected trailing result set was found when reading the results of a SaveChanges operation; this may indicate that a stored procedure returned a result set without being configured for it in the EF model. Check your stored procedure definitions.

public static readonly EventId UnexpectedTrailingResultSetWhenSaving

Field Value

EventId

Remarks

This event is in the Microsoft.EntityFrameworkCore.DbLoggerCategory.Update category.