Created
February 26, 2012 17:51
-
-
Save kevinpang/1917946 to your computer and use it in GitHub Desktop.
CreateSessionFactory
This file contains 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
public static ISessionFactory CreateSessionFactory() | |
{ | |
return Fluently.Configure() | |
.Database(MsSqlConfiguration.MsSql2005.ConnectionString(c => c.FromConnectionStringWithKey("InsertConnectionString"))) | |
.Mappings(m => | |
{ | |
// Include both standard NHibernate mapping files and Fluent NHibernate mapping files | |
m.HbmMappings.AddFromAssemblyOf<User>(); | |
m.FluentMappings.AddFromAssemblyOf<User>(); | |
}) | |
.BuildSessionFactory(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment