I have a self-referencing table which I use to build my tree view.
I use the following query to get the right structure:
public IList<TreeNode> GetAllTreeNodes(string userid)
{
var query = Session.Query<TreeNode>()
.FetchMany(x => x.Children)
.Where(tn => (tn.User.Id == userid) && tn.IsDeleted == false);
return query.ToList();
}
The only problem with that is that my query ignores the IsDeleted flag of my children collection.
How can I tell NHibernate to query all my not deleted items and their corresponding not deleted children?
Cheers, Stefan