Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build Fluent nHibernate SQLite configuration in memory
/// <summary>
/// Builds the configuration.
/// </summary>
/// <returns>nHibernate SQLite configuration</returns>
protected override Configuration BuildConfiguration()
{
CleanUpDbFileIfRequired();
return Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory()
.AutoQuoteAllKeywords())
.Mappings(m => m.FluentMappings
.AddFromAssembly(typeof(FluentAbstract).Assembly))
.ExposeConfiguration(x => x.SetProperty(NHibernate.Cfg.Environment.ReleaseConnections, "on_close"))
.CurrentSessionContext<ThreadStaticSessionContext>()
.BuildConfiguration();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment