0
我有以下方法。如果我刪除以下行這工作得很好nhibernate:如何查詢父實體內部的集合
.Add(Restrictions.Eq("Product.IsPopItem", true))
的錯誤消息是
無法解析屬性:的Product.IsPopItem:EStore.Domain.Model.ProductCategory
我確信「Product.IsPopItem」映射正確,因爲我可以調用此屬性。我是否需要添加一些標準。
public ICollection<ProductCategory> FindByCompanyIdAndCategoryIdAndIsPop(int companyId, int id)
{
var products = _session
.CreateCriteria(typeof(ProductCategory))
.Add(Restrictions.Eq("CompanyId", companyId))
.Add(Restrictions.Eq("CategoryId", id))
.Add(Restrictions.Eq("Product.IsPopItem", true))
.List<ProductCategory>();
return products;
}
打我,就像我開始鍵入:) – pythonandchips 2010-06-08 11:54:38
:)對不起,只是幫助與同事同事 – isuruceanu 2010-06-08 11:59:59
很好,很酷。 – frosty 2010-06-09 14:40:48