I'm doing a query in NHibernate, but I'm not able to get the desired result, I want to bring all my items from the file table that have no relation to another table called Layouts, I tried to use a where to get it back, but when I called the method inside my combo box, it was empty and checking in the bank I saw that there are 3 unrelated items. Code below.
public Ilist <Arquivo> ConsultaSemLayout()
{
using (ISession session = FluentnHibernate.OpenSession())
{
return (from e in session.Query<Arquivo>() where e.Layout.Id == null select e).ToList();
}
}