C# Class NHibernate.AdoNet.SqlClientSqlCommandSet

Expose the batch functionality in ADO.Net 2.0 Microsoft in its wisdom decided to make my life hard and mark it internal. Through the use of Reflection and some delegates magic, I opened up the functionality. Observable performance benefits are 50%+ when used, so it is really worth it.
Inheritance: IDisposable
Mostra file Open project: nhibernate/nhibernate-core Class Usage Examples

Public Methods

Method Description
Append ( SqlCommand command ) : void

Append a command to the batch

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ExecuteNonQuery ( ) : int

Executes the batch

Private Methods

Method Description
AssertHasParameters ( SqlCommand command ) : void

This is required because SqlClient.SqlCommandSet will throw if the command has no parameters.

SqlClientSqlCommandSet ( ) : System

Method Details

Append() public method

Append a command to the batch
public Append ( SqlCommand command ) : void
command System.Data.SqlClient.SqlCommand
return void

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

ExecuteNonQuery() public method

Executes the batch
public ExecuteNonQuery ( ) : int
return int