Skip to content
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

Ugly workaround for issue T410383. #70

Closed
wants to merge 1 commit into from
Closed

Ugly workaround for issue T410383. #70

wants to merge 1 commit into from

Conversation

jtheisen
Copy link

@jtheisen jtheisen commented Aug 2, 2016

See ticket T410383.

@AlekseyMartynov
Copy link
Contributor

Hi @jtheisen

Could you please check if rewriting the query as suggested in http://stackoverflow.com/a/23558389 helps?

from e in db.MyEntities
from o in db.MyOtherEntities.Where(o => o.Foo == e.Foo).DefaultIfEmpty()
select new {
    Value1 = e.Value1,
    Value2 = e.Value2
};

@jtheisen
Copy link
Author

jtheisen commented Aug 3, 2016

Yes, it does.

I just figured what also helps if there's a spurious where clause after the join, such as

where e.Value1 == e.Value1

Just writing where true is not enough though.

Very mysterious.

Ok, now that there's a (less ugly) workaround there's no point in the pull request.

I wrote this SO Q/A: http://stackoverflow.com/questions/38743577/the-nested-query-is-not-supported-entity-framework-fails-on-grouped-left-joins

And maybe there should be a bug report to EF - I won't be the last tripping over this.

If you want to be really nice to your users, you could catch the NotSupportedException and rethrow with a piece of info attached with a link to this or SO in case that's the issue.

@jtheisen
Copy link
Author

jtheisen commented Aug 3, 2016

Tried to file a bug an connect.microsoft.com but failed. The site's too buggy itself.

@AlekseyMartynov
Copy link
Contributor

Tried to file a bug an connect.microsoft.com but failed.

Good news, EF6 is now on GitHub: https://github.com/aspnet/EntityFramework6

If you want to be really nice to your users, you could catch the NotSupportedException and rethrow with a piece of info attached with a link to this or SO in case that's the issue.

That's a good idea. We'll keep it in mind.
Thanks.

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

Successfully merging this pull request may close these issues.

None yet

2 participants