CarrotCMSData/LinqToSqlExtensions.cs
/// <summary>
/// Immediately deletes all entities from the collection with a single delete command.
/// </summary>
/// <typeparam name="TEntity">Represents the object type for rows contained in <paramref name="table"/>.</typeparam>
/// <param name="table">Represents a table for a particular type in the underlying database containing rows are to be deleted.</param>
/// <param name="entities">Represents the collection of items which are to be removed from <paramref name="table"/>.</param>
/// <returns>The number of rows deleted from the database.</returns>
/// <remarks>
/// <para>Similiar to stored procedures, and opposite from DeleteAllOnSubmit, rows provided in <paramref name="entities"/> will be deleted immediately with no need to call <see cref="DataContext.SubmitChanges()"/>.</para>
/// <para>Additionally, to improve performance, instead of creating a delete command for each item in <paramref name="entities"/>, a single delete command is created.</para>
/// </remarks>
Immediately deletes all entities from the collection with a single delete command.
Immediately deletes all entities from the collection with a single delete command .
public static int DeleteBatch<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities ) where TEntity : class
		{
			DbCommand delete = table.GetDeleteBatchCommand<TEntity>( entities );
			var parameters = from p in delete.Parameters.Cast<DbParameter>()
							 select p.Value;
			return table.Context.ExecuteCommand( delete.CommandText, parameters.ToArray() );
		}
public static int DeleteBatch < TEntity > ( this Table < TEntity > table , IQueryable < TEntity > entities ) where TEntity : class { DbCommand delete = table . GetDeleteBatchCommand < TEntity > ( entities ) ; var parameters = from p in delete . Parameters . Cast < DbParameter > ( ) select p . Value ; return table . Context . ExecuteCommand ( delete . CommandText , parameters . ToArray ( ) ) ; }
Immediately deletes all entities from the collection with a single delete command.
Immediately deletes all entities from the collection with a single delete command .
The number of rows deleted from the database.
The number of rows deleted from the database .
Table<TEntity>
this
entities
IQueryable<TEntity>
Represents the collection of items which are to be removed from .
Represents the collection of items which are to be removed from .
table
Represents a table for a particular type in the underlying database containing rows are to be deleted.
Represents a table for a particular type in the underlying database containing rows are to be deleted .
typeparam
Represents the object type for rows contained in .
Represents the object type for rows contained in .
remarks
Similiar to stored procedures, and opposite from DeleteAllOnSubmit, rows provided in  will be deleted immediately with no need to call .Additionally, to improve performance, instead of creating a delete command for each item in , a single delete command is created.
Similiar to stored procedures and opposite from DeleteAllOnSubmit rows provided in will be deleted immediately with no need to call . Additionally to improve performance instead of creating a delete command for each item in a single delete command is created .