0
나중에 ObjectFactory.GetNamedInstance ("MyNHConfiguration")를 할 수 있도록 다음을 다시 작성할 수 있습니까? "구성"은 ExposeConfiguration 아래의 "cfg"변수에 있습니다.구조체의 도움이 필요합니다
ForRequestedType<ISessionFactory>()
.CacheBy(InstanceScope.Singleton)
.AddInstances(x => x.ConstructedBy(() =>
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=xxcxcca;Password=password;Database=cccvddd;")
.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("MySessionFactory"));