Adding Assemblies - Session Factory
I am currently doing the following to create my session factories:
private ISessionFactory CreateSessionFactory(String connectionString)
{
return Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(
C => C.Is(connectionString)))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Scenario>())
.ExposeConfiguration(cfg =>
{
new SchemaExport(cfg)
.Create(false, false);
})
.BuildSessionFactory();
}
I would like to do :
private ISessionFactory CreateSessionFactory(Assembly assemblyWithMappings,String connectionString)
{
return Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(
C => C.Is(connectionString)))
.Mappings(m => m.FluentMappings.AddFromAssembly(assemblyWithMappings))
.ExposeConfiguration(cfg =>
{
new SchemaExport(cfg)
.Create(false, false);
})
.BuildSessionFactory();
}
This returns without error but the SessionFactory is null.
I am doing the the following to get my assembly
analyticsAssembly = typeof(Scenario).Assembly;
Any ideas on what I am doing wrong?