ProductCategory productCategory = null;
var subquery = QueryOver.Of<Product>()
.JoinAlias(product => product.ProductCategories, () => productCategory)
.Where(() => productCategory.Category.Id == parameter.Category.Id);
类别的类型是什么?如果这是一个实体:
productCategory.Category.Id == parameter.Category.Id
如果这是基本属性:
productCategory.Category == parameter.Category
是多对多的关系吗?(产品和类别)
Category category = null;
var subquery = QueryOver.Of<Product>()
.JoinAlias(product => product.Category, () => category)
.Where(() => category.Id == parameter.Category.Id);