How to setup fluent nhibernate to work with Fitnesse
- by Toran Billups
I'm currently using fluent nhibernate and can't seem to get the configuration to work when using Fitnesse.
For starters I have a FitServer.exe.config that looks like the below
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings file='C:\projectpath\web.config' />
</configuration>
Then inside my web.config I have a connection string defined
But will Fitnesse work when I use the following config? (using the ConnectionString config)
private static ISessionFactory CreateSessionFactory()
{
var cfg = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2005.ConnectionString(c => c.FromConnectionStringWithKey("Local")))
.Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()))
.ExposeConfiguration(x => x.SetProperty("current_session_context_class", "thread"));
return cfg.BuildSessionFactory();
}