I have the following problem:
public IList<Category> GetLeafCategories()
{
// select all categories that are not ParentCategory
string sqlQuery = @"
select * from Catalog_Categories c
where c.CategoryId not in (
select distinct ParentCategoryId
from Catalog_Categories)
";
//
// I need an equivalent nHibernate query
//
var categs = NHibernateSession.Current.Query<Category>();
IQueryable<Category> leafCategs = from cat in categs
where cat.Id not in // HOW TO???
(from c in categs
select c.ParentCategory.Id)
select cat;
return leafCategs.ToList();
}