-
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
Update from 2.0 to 2.1.1: InvalidCastException when casting to/from enum in query. #12557
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
type-bug
Milestone
Comments
Triage: marking this as investigation for patch since the scenario is simple and it is a regression. |
ajcvickers
added a commit
that referenced
this issue
Jul 6, 2018
Fixes #12557 This is a simple case that used to work for enums because they were always converted to their underlying type anyway. However, it falls out of the space where normal value converters would be expected to work, so to bring back the old behavior we check if the parameter type is already the underlying type for enum conversions and, if so, don't try to convert it.
AndriySvyryd
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Jul 12, 2018
AndriySvyryd
added a commit
that referenced
this issue
Jul 12, 2018
roji
added a commit
to npgsql/efcore.pg
that referenced
this issue
Oct 18, 2018
roji
added a commit
to npgsql/efcore.pg
that referenced
this issue
Oct 18, 2018
This issue has reappeared and the sample program also fails on EF Core 3.1.3. I've attached an |
@mmjsd I am able to repro this on 3.1.3. It looks like it is fixed by #19128 which will be released in 3.1.4. It's also fixed in EF Core 5.0 preview 3 which is already available. |
This was referenced Jul 30, 2021
1 task
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
regression
type-bug
In EF Core 2.0 queries like these would work:
(Status is an enum)
However, after updating to EF Core 2.1.1 I get the following exception:
Steps to reproduce
Project: EFCoreTest.zip
Further technical details
EF Core version: 2.1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017 15.7.4
The text was updated successfully, but these errors were encountered: