Cannot find the right overloaded NHibernate Execute function
I can't find the overload function of NHibernate SchemaExport.Execute
开发者_JS百科http://ayende.com/Blog/archive/2009/04/28/nhibernate-unit-testing.aspx
What does this four booleans do?
new SchemaExport(Configuration).Execute(true, true, false, true, session.Connection, Console.Out);
In NH2.1 the 4th bool parameter to SchemaExport.Execute() was eliminated. It indicated that you wanted the DDL nicely formatted. If you ask NH2.1+ to script the DDL to the console, it formats it nicely by default. No need for a separate option. Here is the signature from NH2.0...
/// <summary>
/// Executes the Export of the Schema in the given connection
/// </summary>
/// <param name="script"><see langword="true" /> if the ddl should be outputted in the Console.</param>
/// <param name="export"><see langword="true" /> if the ddl should be executed against the Database.</param>
/// <param name="justDrop"><see langword="true" /> if only the ddl to drop the Database objects should be executed.</param>
/// <param name="format"><see langword="true" /> if the ddl should be nicely formatted instead of one statement per line.</param>
/// <param name="connection">
/// The connection to use when executing the commands when export is <see langword="true" />.
/// Must be an opened connection. The method doesn't close the connection.
/// </param>
/// <param name="exportOutput">The writer used to output the generated schema</param>
/// <remarks>
/// This method allows for both the drop and create ddl script to be executed.
/// This overload is provided mainly to enable use of in memory databases.
/// It does NOT close the given connection!
/// </remarks>
public void Execute(bool script, bool export, bool justDrop, bool format,
IDbConnection connection, TextWriter exportOutput)
-- remainder of method --
精彩评论