Created
September 10, 2013 18:27
-
-
Save gscattolin/6513486 to your computer and use it in GitHub Desktop.
Create Session factory in Fluent NHibernate
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
| 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