Created
December 17, 2012 17:08
-
-
Save akimboyko/4319926 to your computer and use it in GitHub Desktop.
Build Fluent nHibernate SQLite configuration in memory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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