【发布时间】:2011-02-02 16:57:16
【问题描述】:
我正在尝试将 Fluent-Nibernate 与需要 Observable 集合的 wpf 一起使用(实现 INotifyCollectionChanged 接口)。
在uNHAddins: Unofficial addins for NHibernate我找到了
uNhAddIns.WPF.Collections.Types.ObservableListType<T>
实现INotifyCollectionChanged。在 Fluent-Nibernate 中可以这样配置
namespace FluentNHibernateTutorial.Mappings
{
public class StoreMap : ClassMap<Store>
{
public StoreMap()
{
Id(x => x.Id);
Map(x => x.Name);
HasManyToMany(x => x.Products)
.CollectionType<uNhAddIns.WPF.Collections.Types
.ObservableListType<Product>>()
.Cascade.All()
.Table("StoreProduct");
}
}
}
有人知道如何使用 Fluent-Nibernate 实现约定,始终使用 ObservableListType 作为默认 IList 实现?
更新:完美的解决方案是用 Fluent-NHibernate-Automapper 替换
【问题讨论】:
标签: wpf collections fluent-nhibernate nhibernate-mapping nhibernate-collections