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

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-12-03
猜你喜欢
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-02-16
相关资源
相似解决方案