http://stackoverflow.com/questions/12930477/nhibernate-could-not-resolve-property
QueryOver is not the same as the Linq query provider. It would be easier to do:
NHibernateSession.Query<Message>().Where(x => x.User.Name== name).ToList();
But if you want to use QueryOver, you will need to explicitly join the relationships you want to navigate:
NHibernateSession.QueryOver<Message>().JoinQueryOver(x => x.User)// navigate to the user on the relationship.Where(u => u.Name== name)// this restriction is on the User now.List();
you could also do this using an alias for user