How to setup fluent nhibernate to work with Fitnesse
Posted
by Toran Billups
on Stack Overflow
See other posts from Stack Overflow
or by Toran Billups
Published on 2010-06-11T12:59:36Z
Indexed on
2010/06/11
13:02 UTC
Read the original article
Hit count: 386
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();
}
© Stack Overflow or respective owner