Hi,
[Not sure where to post, since it's an nHibernate Question]
I'm stuck using the newer build in mapping by code with nHibernate in a many to many relationship between my User and Role objects (each got an Id member and an IList<T> of the other)
My mapping class (for user) look as follows:
Code:
public UserMap()
{
    Table("Users");
    Property(x => x.UserName);
    ....
    Bag(u => u.Roles,
        map =>
            {
                //map.Access(Accessor.Field);
                map.Table("Users_Roles");
                map.Cascade(Cascade.All);
                map.Key(k => k.Column("UserId"));
                map.Inverse(true);
            },
            u => u.ManyToMany(x => x.Column("RoleId")));
Like that it gives me an error:
"An association from the table Users_Roles refers to an unmapped class"
If I uncomment the line map.Access(Accessor.Field); it tells me:
"Could not compile the mapping document: mapping_by_code"

Anyone know this mapping by code well (I'm not talking about FluentNHibernate and not using xml mapping)