J'ai la méthode suivante. Cela fonctionne bien si je supprime la ligne suivantenhibernate: comment interroger la collection à l'intérieur de l'entité parente
.Add(Restrictions.Eq("Product.IsPopItem", true))
Le message d'erreur est
ne pouvait pas résoudre la propriété: Product.IsPopItem de: EStore.Domain.Model.ProductCategory
Je suis confiant que le "Product.IsPopItem" est mappé correctement que je peux appeler cette propriété. Ai-je besoin d'ajouter quelques critères.
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;
}
battu moi juste comme j'ai commencé à taper :) – pythonandchips
:) désolé, juste aidé un collègue avec le même problème – isuruceanu
super, très cool. – frosty