RelationalQueryableExtensions.CreateDbCommand(IQueryable) Method

Definition

Creates a DbCommand set up to execute this query.

public static System.Data.Common.DbCommand CreateDbCommand (this System.Linq.IQueryable source);
static member CreateDbCommand : System.Linq.IQueryable -> System.Data.Common.DbCommand
<Extension()>
Public Function CreateDbCommand (source As IQueryable) As DbCommand

Parameters

source
IQueryable

The query source.

Returns

The query string for debugging.

Remarks

This is only typically supported by queries generated by Entity Framework Core.

Warning: there is no guarantee that executing this command directly will result in the same behavior as if EF Core had executed the command.

Note that DbCommand is an IDisposable object. The caller is responsible for disposing the returned command.

This is only typically supported by queries generated by Entity Framework Core.

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

Applies to