-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
3.0 regression: Cannot use generics w/ interface to construct expression #17794
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Comments
joakimriedel
changed the title
3.0 regression:
3.0 regression: Cannot use generics w/ interface to construct expression
Sep 12, 2019
Putting this in 3.1 as it was spin-off of #17617 for specific bug. |
Interesting. It seems the cast to IOffer is causing the parse issue. This works: var query = await context.Offers.Where(v => v.Actions.Any(oa => oa.Action == OfferActions.Accepted)).CountAsync(); This doesn't work: var query = await context.Offers.Where(v => ((IOffer)v).Actions.Any(oa => oa.Action == OfferActions.Accepted)).CountAsync(); The expression generated by the generic function includes the cast. It's certainly possible to write code to generate an expression by hand within the generic function that does not include the cast, although perhaps a bit complicated. |
smitpatel
added a commit
that referenced
this issue
Oct 30, 2019
smitpatel
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Oct 30, 2019
smitpatel
added a commit
that referenced
this issue
Oct 30, 2019
smitpatel
added a commit
that referenced
this issue
Oct 30, 2019
smitpatel
added a commit
that referenced
this issue
Oct 31, 2019
smitpatel
added a commit
that referenced
this issue
Nov 1, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Pre-3.0 it was possible to construct an expression using generics & interface. With 3.0 daily builds, you get an exception for the exact same code. From #17617
Steps to reproduce
Please look at the following gist for a reproducible example:
https://gist.github.com/jcemoller/312a2aaa3c27ec18318881619439e867
Further technical details
EF Core version: 3.0.0-rc2
Database provider: SqlServer & InMemory
Target framework: .NET Core 3.0
Operating system: Win10
IDE: Visual Studio 2019 preview
The text was updated successfully, but these errors were encountered: