NHibernate QueryOver with ManytoMany

后端 未结 1 1142
小蘑菇
小蘑菇 2020-12-17 01:33

I\'m in the process of learning QueryOver, but I can\'t for my life figure out how to do simple many to many queries.

I\'ve written the following:

           


        
相关标签:
1条回答
  • 2020-12-17 01:43

    I ended up resolving this after a lot of perseverance.

                var result = Session.QueryOver<Product>()
                                .Right.JoinQueryOver<Category>(x => x.Categories)
                                .Where(c => c.Id == categoryId)
                                .List();
    

    What a mission :)

    0 讨论(0)
提交回复
热议问题