Не удается найти нужную перегруженную функцию выполнения NHibernate - PullRequest
1 голос
/ 02 декабря 2010

Не удается найти функцию перегрузки NHibernate SchemaExport.Execute

http://ayende.com/Blog/archive/2009/04/28/nhibernate-unit-testing.aspx

Что делают эти четыре логических значения?

new SchemaExport(Configuration).Execute(true, true, false, true, session.Connection, Console.Out);

1 Ответ

2 голосов
/ 02 декабря 2010

В NH2.1 4-й параметр bool для SchemaExport.Execute () был исключен. Это указывало на то, что вы хотите, чтобы DDL был красиво отформатирован. Если вы попросите NH2.1 + записать DDL на консоль, он по умолчанию отформатирует его. Нет необходимости в отдельной опции. Вот подпись от 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 --
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...