我试图在我的解决方案中使用Fluent NHibernate,使用以下NHibernate xml配置部分进行配置
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="mitre">
<property name="dialect">NHibernate.Dialect.Oracle9iDialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="connection.connection_string">Data Source=YOUR_DB_SERVER;Database=Northwind;User ID=YOUR_USERNAME;Password=YOUR_PASSWORD;</property>
<property name="connection.isolation">ReadCommitted</property>
<property name="default_schema">TRATE</property>
<!-- HBM Mapping Files -->
<mapping assembly="Markel.Mint.Mitre.Data" />
</session-factory>
</hibernate-configuration>
Run Code Online (Sandbox Code Playgroud)
在我的代码文件中,要实例化ISession:
NH_Cfg.Configuration cfg = new NH_Cfg.Configuration();
cfg.Configure();
Fluently.Configure(cfg).Mappings(m => m.FluentMappings = ????)
Run Code Online (Sandbox Code Playgroud)
我的问题是,如果我已经在NHibernate配置部分中指定了程序集,我是否需要显式设置FluentMappings?如果是这样,那么可以通过编程方式从NHibernate配置中检索这些数据吗?
谢谢奥兹