You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[9 regression] No coercion operator is defined between types #36873
This worked without issues in EF Core 8, but in EF Core 9 it crashes with:
Error: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: No coercion operator is defined between types
'Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer`1[PROJECT_NAME.Enums.MailHistoryStatus]' and
'Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer`1[System.Int32]'.
@Inspirateur Could you provide a small repro console app project? The above snippets are not enough to reproduce the issue.
I can't send the original code (proprietary) but i'll do my best to create a minimal project on monday :)
I'm surprised the snippets weren't enough though! I really thought it included all the elements that mattered.
I think the main issue for EF 9 is that I'm doing EF.Property<int>(cf!, PropertyName) on a property which is technically not an int (even though it's stored as an int in the DB).
A workaround that works for me is adding another generic type which represents the exact type of the property I'm querying, and then converting it to a int like so: Convert.ToInt32(EF.Property<TKey>(cf!, PropertyName))
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.
Activity
MihuBot commentedon Sep 26, 2025
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
AndriySvyryd commentedon Sep 26, 2025
@Inspirateur Could you provide a small repro console app project? The above snippets are not enough to reproduce the issue.
Inspirateur commentedon Sep 27, 2025
I can't send the original code (proprietary) but i'll do my best to create a minimal project on monday :)
I'm surprised the snippets weren't enough though! I really thought it included all the elements that mattered.
I think the main issue for EF 9 is that I'm doing
EF.Property<int>(cf!, PropertyName)on a property which is technically not an int (even though it's stored as an int in the DB).A workaround that works for me is adding another generic type which represents the exact type of the property I'm querying, and then converting it to a int like so:
Convert.ToInt32(EF.Property<TKey>(cf!, PropertyName))cincuranet commentedon Oct 3, 2025
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.