EntityFrameworkQueryableExtensions.ToQueryString(IQueryable) Method

Definition

Generates a string representation of the query used. This string may not be suitable for direct execution and is intended only for use in debugging.

public static string ToQueryString (this System.Linq.IQueryable source);
static member ToQueryString : System.Linq.IQueryable -> string
<Extension()>
Public Function ToQueryString (source As IQueryable) As String

Parameters

source
IQueryable

The query source.

Returns

The query string for debugging.

Exceptions

source is null.

Remarks

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

See Viewing SQL generated by EF Core for more information and examples.

Applies to