Skip to content

NH-3845, NH-3946 - Fix Linq queries with .OfType<T>() and where is T, where T is a mapped base type #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2017

Conversation

alexDevBR
Copy link
Contributor

@alexDevBR alexDevBR commented Feb 14, 2017

Patch allows queries like session.Query<Animal>().Where(x => x is Mammal) and session.Query<Animal>().OfType<Mammal>() to get all dogs and cats, for example.

…ic from SingleTableEntityPersister.DiscriminatorFilterFragment to find subclasses. Seems to work with JoinedSubclassEntityPersister as well
@hazzik
Copy link
Member

hazzik commented Feb 14, 2017

Related to #456. Maybe the logic shall be combined.

@hazzik hazzik changed the title Nh 3946 - Linq where x is base class doesn't get subclasses NH-3946 - Linq where x is base class doesn't get subclasses Feb 14, 2017
@hazzik
Copy link
Member

hazzik commented Feb 14, 2017

@alexDevBR I've hijacked your PR to also (partially) fix NH-3845

@hazzik hazzik changed the title NH-3946 - Linq where x is base class doesn't get subclasses NH-3845, NH-3946 - Fix Linq queries with .OfType<T>() and where is T, where T is a mapped base type Feb 14, 2017
@hazzik hazzik merged commit 85ca554 into nhibernate:master Feb 14, 2017
@hazzik hazzik added this to the 5.0.0 milestone Feb 28, 2017
@hazzik hazzik added the r: Fixed label Aug 3, 2017
@fredericDelaporte
Copy link
Member

@hazzik

I've hijacked your PR to also (partially) fix NH-3845

Should we re-open NH-3845 (auto-resolved by merging this PR) and move it to 5.1.0?

@hazzik
Copy link
Member

hazzik commented Sep 20, 2017

Yes
@fredericDelaporte no, I've extracted the not fixed cases into NH-3947

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants