SimplifyNet / Simplify

Simplify is an open-source set of lightweight .NET libraries that provide infrastructure for your applications. DI and mocking friendly.

Home Page:https://simplifynet.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UpdateSchema extension method for FluentConfiguration

i4004 opened this issue · comments

Is your feature request related to a problem? Please describe.

Current schema update script looks like this

[Test]
public void UpdateSchema()
{
	var configuration = new MySessionFactoryBuilder(/* IConfiguration */)).CreateConfiguration();

	Configuration config = null;
	configuration.ExposeConfiguration(c => config = c);
	configuration.BuildSessionFactory();

	config.CreateIndexesForForeignKeys();

	var updater = new NHibernate.Tool.hbm2ddl.SchemaUpdate(config);
	updater.Execute(true, true);
}

Describe the solution you'd like
This code can be moved to Simplify.FluentNHibernate as an extension method for FluentConfiguration with ability to extend Configuration