Table of Contents

Enum CommandSource

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

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

public enum CommandSource

Fields

[Obsolete("Use ExecuteDelete or ExecuteUpdate instead.")] BulkUpdate = 8

The command was generated as part of a bulk update.

ExecuteDelete = 9

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

ExecuteSqlRaw = 5

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

ExecuteUpdate = 8

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

FromSqlQuery = 4

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

LinqQuery = 1

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

Migrations = 3

The command was generated by EF Core Migrations.

SaveChanges = 2

The command was generated from a call to Microsoft.EntityFrameworkCore.DbContext.SaveChanges or Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(System.Threading.CancellationToken)

Scaffolding = 7

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

Unknown = 0

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

ValueGenerator = 6

The command was generated by a ValueGenerator.

Remarks

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