Saturday, November 26, 2011

NHibernate MappingByCode ManyToMany

I was not able to find a "loquacious" conformist example about a many-to-many relation mapping, so after play a bit with it, I finally deal with it.
Here an example:

 Bag(x => x.ManyToManyCollection
   , map =>
        map.Key(k => k.Column("child_key_column"));
   , action => action.ManyToMany(m => m.Column("parent_key_column")));

Happy mapping! ^^

No comments:

Post a Comment