Skip to content

Instantly share code, notes, and snippets.

@gscattolin
Created September 10, 2013 18:27
Show Gist options
  • Select an option

  • Save gscattolin/6513486 to your computer and use it in GitHub Desktop.

Select an option

Save gscattolin/6513486 to your computer and use it in GitHub Desktop.
Create Session factory in Fluent NHibernate
private static ISessionFactory CreateSessionFactory()
{
//const string Connstring = "server=SWIGVA01-SRV341;database=LeafPoint_Global;" +
// "User Id=lp_global;Password=lp_gl0b4l;";
const string Connstring = @"server=.\SQLEXPRESS;database=SimpleDB;" +
"Integrated Security=SSPI;";
return Fluently.Configure()
.Database(MsSqlConfiguration
.MsSql2008
.ConnectionString(Connstring).ShowSql())
.Mappings(m => m.FluentMappings
.AddFromAssemblyOf<FunctionMap>())
.BuildSessionFactory();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment