Tools/LinqToSqlExtensions.cs
/// <summary>
/// Returns a string representation the LINQ <see cref="IProvider"/> command text and parameters used that would be issued to perform the query's select statement.
/// </summary>
/// <param name="context">The DataContext to execute the batch select against.</param>
/// <param name="query">Represents the SELECT query to execute.</param>
/// <returns>Returns a string representation of the <see cref="DbCommand.CommandText"/> along with <see cref="DbCommand.Parameters"/> if present.</returns>
/// <remarks>This method is useful for debugging purposes or when used in other utilities such as LINQPad.</remarks>
Returns a string representation the LINQ  command text and parameters used that would be issued to perform the query's select statement.
Returns a string representation the LINQ command text and parameters used that would be issued to perform the query ' s select statement .
public static string PreviewCommandText( this DataContext context, IQueryable query )
		{
			var cmd = context.GetCommand( query );
			return cmd.PreviewCommandText( false);
		}
public static string PreviewCommandText ( this DataContext context , IQueryable query ) { var cmd = context . GetCommand ( query ) ; return cmd . PreviewCommandText ( false ) ; }
Returns a string representation the LINQ  command text and parameters used that would be issued to perform the query's select statement.
Returns a string representation the LINQ command text and parameters used that would be issued to perform the query ' s select statement .
Returns a string representation of the  along with  if present.
Returns a string representation of the along with if present .
DataContext
this
query
IQueryable
Represents the SELECT query to execute.
Represents the SELECT query to execute .
context
The DataContext to execute the batch select against.
The DataContext to execute the batch select against .
remarks
This method is useful for debugging purposes or when used in other utilities such as LINQPad.
This method is useful for debugging purposes or when used in other utilities such as LINQPad .