Share via


CommandSource Enum

Definition

Enum used by CommandEventData, and subclasses to indicate the source of the DbCommand being used to execute the command.

public enum CommandSource
type CommandSource = 
Public Enum CommandSource
Inheritance
CommandSource

Fields

Name Value Description
Unknown 0

The command was generated from an unknown source. This usually indicates a database provider-generated command.

LinqQuery 1

The command was generated from a LINQ query on a DbSet<TEntity>.

SaveChanges 2

The command was generated from a call to SaveChanges() or SaveChangesAsync(CancellationToken)

Migrations 3

The command was generated by EF Core Migrations.

FromSqlQuery 4

The command was generated from a call to FromSql<TEntity>(DbSet<TEntity>, FormattableString), FromSqlRaw<TEntity>(DbSet<TEntity>, String, Object[]) or FromSqlInterpolated<TEntity>(DbSet<TEntity>, FormattableString)

ExecuteSqlRaw 5

The command was generated from a call to ExecuteSqlRaw(DatabaseFacade, String, Object[]), ExecuteSqlRawAsync(DatabaseFacade, String, CancellationToken), ExecuteSql(DatabaseFacade, FormattableString), ExecuteSqlAsync(DatabaseFacade, FormattableString, CancellationToken), ExecuteSqlInterpolated(DatabaseFacade, FormattableString), or ExecuteSqlInterpolatedAsync(DatabaseFacade, FormattableString, CancellationToken).

ValueGenerator 6

The command was generated by a ValueGenerator.

Scaffolding 7

The command was generated as part of scaffolding (reverse-engineering) from an existing database.

BulkUpdate 8

The command was generated as part of a bulk update.

ExecuteUpdate 8

The command was generated as part of an 'ExecuteUpdate' operation.

ExecuteDelete 9

The command was generated as part of an 'ExecuteDelete' operation.

Remarks

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

Applies to