Skip to content

Instantly share code, notes, and snippets.

@akimboyko
Created December 17, 2012 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akimboyko/4319926 to your computer and use it in GitHub Desktop.
Save akimboyko/4319926 to your computer and use it in GitHub Desktop.
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