I\'m trying to get distinct results using the Criteria API in NHibernate. I know this is possible using HQL, but I would prefer to do this using the Criteria API, because th
I also ran into the problem of the non-distinct number of items (I use a fetch="join" in my mapping file). I used Linq To Nhibernate to solve the problem, which is used in the following way:
var suppliers = (from supplier in session.Linq()
from product in supplier.Products
where product.Category.Name == produtCategoryName
select supplier).ToList().Distinct();