I use StructureMap with FluentNHibernate to set it up. Thought I could
get it from SessionFactory without having to re-write it so that I
hold on to reference to the Configuration in container.
ForRequestedType<ISessionFactory>()
.CacheBy(InstanceScope.Singleton)
.AddInstances(x => x.ConstructedBy(() =>
//
ObjectFactory.GetInstance<FluentConfiguration>()
Fluently.Configure()
.Database
(MsSqlConfiguration.MsSql2005
.AdoNetBatchSize(10)
.Driver
("NHibernate.Driver.SqlClientDriver")
.ProxyFactoryFactory
("NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle")
.UseOuterJoin()
.ConnectionString(@"Server=.
\SQLEXPRESS;User Id=epitka;Password=password;Database=dnn49;")
.ShowSql()
.CurrentSessionContext
("thread_static")) // CHANGE THIS FOR WEB
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<MetaProject>())
.ExposeConfiguration(
cfg =>{
cfg.SetProperty(
Environment.TransactionStrategy,
typeof (AdoNetTransactionFactory).FullName);
cfg.SetProperty(Environment.GenerateStatistics, "true"); //REMOVE FOR
LIVE
})
.BuildSessionFactory())
.WithName
("SharpMod_SessionFactory"));
On Nov 20, 8:20 pm, Fabio Maulo <
fabioma...@gmail.com> wrote:
> curiosity:
> how you have the sessionFactory ?
>
> 2009/11/20 epitka <
exptrade2...@yahoo.com>
>
>
>
>
>
> > I need to get reference to Configuration to run ExportSchema. Is it
> > possible to get it from SessionFactory?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to
nhu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
nhusers+u...@googlegroups.com<
nhusers%2Bunsu...@googlegroups.com >
> > .