System.Data.Common.DbCommand.PreviewCommandText(bool)

Here are the examples of the csharp api class System.Data.Common.DbCommand.PreviewCommandText(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

14 Examples 7

1. Example

View license
public static string DeleteBatchSQL<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteBatchCommand<TEntity>( entities );
			return delete.PreviewCommandText( true );
		}

2. Example

View license
public static string UpdateBatchSQL<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities, Expression<Func<TEntity, TEntity>> evaluator ) where TEntity : class
		{
			DbCommand update = table.GetUpdateBatchCommand<TEntity>( entities, evaluator );
			return update.PreviewCommandText( true );
		}

3. Example

View license
public static string PreviewSQL( this DataContext context, IQueryable query )
		{
			var cmd = context.GetCommand( query );
			return cmd.PreviewCommandText( true );
		}

4. Example

View license
public static string PreviewCommandText( this DataContext context, IQueryable query )
		{
			var cmd = context.GetCommand( query );
			return cmd.PreviewCommandText( false);
		}

5. Example

View license
public static string DeleteBatchSQL<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteBatchCommand<TEntity>( entities );
			return delete.PreviewCommandText( true );
		}

6. Example

View license
public static string UpdateBatchSQL<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities, Expression<Func<TEntity, TEntity>> evaluator ) where TEntity : class
		{
			DbCommand update = table.GetUpdateBatchCommand<TEntity>( entities, evaluator );
			return update.PreviewCommandText( true );
		}

7. Example

View license
public static string PreviewSQL( this DataContext context, IQueryable query )
		{
			var cmd = context.GetCommand( query );
			return cmd.PreviewCommandText( true );
		}

8. Example

View license
public static string PreviewCommandText( this DataContext context, IQueryable query )
		{
			var cmd = context.GetCommand( query );
			return cmd.PreviewCommandText( false);
		}

9. Example

View license
public static string DeleteByPKPreview<TEntity>( this Table<TEntity> table, object primaryKey ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteByPKCommand<TEntity>( primaryKey );
			return delete.PreviewCommandText( false ) + table.Context.GetLog();
		}

10. Example

View license
public static string DeleteByPKPreview<TEntity>( this Table<TEntity> table, object primaryKey ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteByPKCommand<TEntity>( primaryKey );
			return delete.PreviewCommandText( false ) + table.Context.GetLog();
		}

11. Example

View license
public static string DeleteBatchPreview<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteBatchCommand<TEntity>( entities );
			return "Total Rows To Be Deleted By Query: " + entities.Count() + "\n\n" + delete.PreviewCommandText( false ) + table.Context.GetLog();
		}

12. Example

View license
public static string UpdateBatchPreview<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities, Expression<Func<TEntity, TEntity>> evaluator ) where TEntity : class
		{
			DbCommand update = table.GetUpdateBatchCommand<TEntity>( entities, evaluator );
            return "Total Rows To Be Updated By Query: " + entities.Count() + "\n\n" + update.PreviewCommandText( false ) + table.Context.GetLog();
		}

13. Example

View license
public static string DeleteBatchPreview<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteBatchCommand<TEntity>( entities );
			return "Total Rows To Be Deleted By Query: " + entities.Count() + "\n\n" + delete.PreviewCommandText( false ) + table.Context.GetLog();
		}

14. Example

View license
public static string UpdateBatchPreview<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities, Expression<Func<TEntity, TEntity>> evaluator ) where TEntity : class
		{
			DbCommand update = table.GetUpdateBatchCommand<TEntity>( entities, evaluator );
            return "Total Rows To Be Updated By Query: " + entities.Count() + "\n\n" + update.PreviewCommandText( false ) + table.Context.GetLog();
		}