【发布时间】:2011-09-20 14:38:07
【问题描述】:
我偶然发现了以下问题:我想从配置文件配置数据库,但映射流畅(喜欢它!)配置代码如下所示:
var cfg = new Configuration();
cfg.Configure();
var fluentCfg = Fluently.Configure(cfg)
.Mappings(
m => m
.FluentMapping
.AddFromAssembly(Assembly.GetExecutingAssembly));
但是配置文件有一个属性:
<property name="proxyfactory.factory_class">
NHibernate.ByteCode.LinFu.ProxyFactoryFactory,
NHibernate.ByteCode.LinFu
</property>
在 cfg.Configure(); 之后一切看起来都不错,配置指向 LinFu 字节码提供程序,但在第三行之后我看到配置更改为使用 Castle。我查看了 Fluent 的代码,我可能错了,但看起来他们在 PersistenceConfiguration 的构造函数中覆盖了 PersistenceConfiguration.cs(第 50 行)中的这个属性:
values[ProxyFactoryFactoryClassKey] = DefaultProxyFactoryFactoryClassName;
Fluent 需要 Castle 吗?或者可能是我做错了什么,或者这只是一个错误?
谢谢。
【问题讨论】:
标签: nhibernate fluent-nhibernate