I am currently dynamically constructing queries like so:
QueryOver q = QueryOver.Of(); if (foo != null) q = q.Where(b => b.
This is not intuitive, but the following should work fine (QueryOver):
if (bar) q = q.Where(b => b.GetType() == typeof(Derived));
I'm not sure about a way to do this in LINQ-to-NH.