Tools/LinqToSqlExtensions.cs
/// <summary>
/// Immediately updates all entities in the collection with a single update command based on a <typeparamref name="TEntity"/> created from a Lambda expression.
/// </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 updated.</param>
/// <param name="entities">Represents the collection of items which are to be updated in <paramref name="table"/>.</param>
/// <param name="evaluator">A Lambda expression returning a <typeparamref name="TEntity"/> that defines the update assignments to be performed on each item in <paramref name="entities"/>.</param>
/// <returns>The number of rows updated in the database.</returns>
/// <remarks>
/// <para>Similiar to stored procedures, and opposite from similiar InsertAllOnSubmit, rows provided in <paramref name="entities"/> will be updated immediately with no need to call <see cref="DataContext.SubmitChanges()"/>.</para>
/// <para>Additionally, to improve performance, instead of creating an update command for each item in <paramref name="entities"/>, a single update command is created.</para>
/// </remarks>
Immediately updates all entities in the collection with a single update command based on a  created from a Lambda expression.
Immediately updates all entities in the collection with a single update command based on a created from a Lambda expression .
public static int UpdateBatch<TEntity>( this Table<TEntity> table, IQueryable<TEntity> entities, Expression<Func<TEntity, TEntity>> evaluator ) where TEntity : class
		{
			DbCommand update = table.GetUpdateBatchCommand<TEntity>( entities, evaluator );
			var parameters = from p in update.Parameters.Cast<DbParameter>()
							 select p.Value;
			return table.Context.ExecuteCommand( update.CommandText, parameters.ToArray() );
		}
public static int UpdateBatch < TEntity > ( this Table < TEntity > table , IQueryable < TEntity > entities , Expression < Func < TEntity , TEntity > > evaluator ) where TEntity : class { DbCommand update = table . GetUpdateBatchCommand < TEntity > ( entities , evaluator ) ; var parameters = from p in update . Parameters . Cast < DbParameter > ( ) select p . Value ; return table . Context . ExecuteCommand ( update . CommandText , parameters . ToArray ( ) ) ; }
Immediately updates all entities in the collection with a single update command based on a  created from a Lambda expression.
Immediately updates all entities in the collection with a single update command based on a created from a Lambda expression .
The number of rows updated in the database.
The number of rows updated in the database .
Table<TEntity>
this
entities
IQueryable<TEntity>
Represents the collection of items which are to be updated in .
Represents the collection of items which are to be updated in .
evaluator
Expression<Func<TEntity, TEntity>>
A Lambda expression returning a  that defines the update assignments to be performed on each item in .
A Lambda expression returning a that defines the update assignments to be performed on each item in .
table
Represents a table for a particular type in the underlying database containing rows are to be updated.
Represents a table for a particular type in the underlying database containing rows are to be updated .
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 similiar InsertAllOnSubmit, rows provided in  will be updated immediately with no need to call .Additionally, to improve performance, instead of creating an update command for each item in , a single update command is created.
Similiar to stored procedures and opposite from similiar InsertAllOnSubmit rows provided in will be updated immediately with no need to call . Additionally to improve performance instead of creating an update command for each item in a single update command is created .