I\'m having an issue with my linq query. I am trying to filter objects based on selected values. We use a query model which returns a System.Linq.Expressions.Expression and use
I'm pretty sure NHibernate.Linq does not support filtering on class type directly. If you need to distinguish between the types, I would use a property value on the base class (probably an enum) that is set to the proper value in the child classes. You can then perform your comparison like this:
x.Post.Profile.Type = ProfileTypes.BusinessProfile
Just set this property statically in the constructor for the child classes, map it with NHibernate, and set update=false
for the property mapping. Although somewhat inelegant, this should give you the results you're looking for.