1
我NHibernate的搜索相當的流利映射以下屬性爲基礎的繪圖2.1搜索等同功能NHibernate映射 - 映射地圖作爲字典
[Class(typeof(Article), Table = "ARTIKEL")]
public class Article {
[Id(0, Name = "Id", Column = "Id")]
public virtual int Id { get; set; }
[Map(0)]
[Key(1, Column = "MainArticle")]
[IndexManyToMany(2, ClassType = typeof(Article), Column = "ChildArticle")]
[Element(3, Column = "Amount", NotNull = true)]
public virtual IDictionary<Article, decimal> Bundle { get; set; }
}
我沒能獲得一個工作流利的映射的NHibernate 3.0。
我結束了
HasManyToMany<Article>().ParentKeyColumn("MainArticle").ChildKyColumn("ChildArticle").AsMap<int>("Amount");
這將導致一個「非法的存取權限裝載集合」異常時訪問字典...
AsEntityMap在Fluent NHibernate 3.0上沒有簽名'AsEntityMap(string)' – Eruphus 2012-04-18 19:10:56