I'm trying to map a manyToMany relationship in Fluent NHibernate and running into a problem that's most likely just me being new at the tool.
I have 2 Entities, User and Project. A User can be on many projects and a project can have many users.
In my map for User I have
HasManyToMany(x => x.Projects).Inverse();
When i put the identical map in project i get an exception because the table name is opposite. Also i thought I didnt need it based on this post: http://stackoverflow.com/questions/108396/fluent-nhibernate-many-to-many
I'm stepping through this to see if it is working:
var user = _userRepository.FindByUserName("Josh");
var projects = user.Projects;
var user2 = projects[0].Users;
What happens is projects returns a collection containing my project. User2 is null though. I would expect user2 to be a collection containing the same user as user.
So what am i doing wrong. Thanks.