I have the following class hierarchy:
public abstract class Base
{ ...}
public abstract class SpecificBase : Base
{ ...}
public class ConcreteA : SpecificBase
{ ...}
public class ConcreteB : SpecificBase
{ ...}
They are mapped to the same table using a discriminator.
When I query:
session.Query<SpecificBase>().ToList()
The generated SQL uses the discriminators and looks like this:
select (*) from Base where discrim in ('A', 'B')
But if I query:
session.Query<Base>().Where(x => x is SpecificBase).ToList()
//or
session.Query<Base>().OfType<SpecificBase>().ToList()
The SQL looks like this:
select (*) from Base where discrim = 'SpecificBase'
and returns nothing.
Is this a known bug? I know I can just use the first version but I'm having
problems inside subqueries.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.