I search for a equivalent Fluent Mapping for the following Attribute-based mapping in NHibernate 2.1
[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; }
}
I am not able to get a working Fluent Mapping for NHibernate 3.0.
I ended up with
HasManyToMany<Article>().ParentKeyColumn("MainArticle").ChildKyColumn("ChildArticle").AsMap<int>("Amount");
This results in a "Illegal acces to loading collection" Exception while access the Dictionary...