3
我想配置功能NHibernate和有此代码功能NHibernate配置
Assembly mappingAssembly = Assembly.ReflectionOnlyLoadFrom("LibrarySample.Model.dll");
sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2005
.ConnectionString(c => c
.FromAppSetting("ConnectionString"))
.ShowSql())
.Mappings(m => m
.FluentMappings.AddFromAssembly(mappingAssembly))
.BuildSessionFactory();
当我跑我得到这个消息,虽然“FluentNHibernate.Cfg.FluentConfigurationException:创建一个会话使用了无效的或不完整的配置”。
如果我使用此代码,但我不想直接从具有nHibernate会话管理器的核心程序集中引用模型程序集。
sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2005
.ConnectionString(c => c
.FromAppSetting("ConnectionString"))
.ShowSql())
.Mappings(m => m
.FluentMappings.AddFromAssemblyOf<LibrarySample.Model.Book>())
.BuildSessionFactory();
有人可以帮忙吗?
我有同样的问题。谢谢! – IRegretable 2011-07-18 22:43:40