I am trying to get Host objects which have E objects of certain type like this:
return Session.Query<Host>().Where(x => x.E is B).ToList();
This does not seem to work probably because E is of type A and B inherits from A. Could the inheritance be the problem. Some more (simplified) details:
class Host
{
public A E { get; set; }
}
class B : A
{
}
Any ideas why the above does not work? Thanks.
PS:
Please note that the above should work – I used the wrong class name!
This code works in LinqPad: