-
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
Exception when using FromSql on entity with ComplexProperty #32699
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
Milestone
Comments
ajcvickers
added a commit
that referenced
this issue
Jan 14, 2024
The difference between the DbSet queries (work) and the FromSql queries (don't work) is that the DbSet queries use the table mappings, while the FromSql queries use the default mappings. The default mappings don't contain complex types. This may be an issue in of itself. Fixes #32699
ajcvickers
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Jan 14, 2024
I encountered the exact same exception when using
Will this fix address it too? |
I am facing the same issue. As soon as I remove my complex type property from my entity, But I could see that in 8.0.8 this issue does not occur anymore. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
Reproduction: EfComplexPropertyFromSqlTests.zip
Given an entity like the following:
Which works fine when inserting and querying normally.
The problem occurs when trying to execute a
FromSql
query like so:Or similar (see the
DoThis
service in the attached code).The following exception is thrown when running the attached code:
Provider and version information
EF Core version: 8
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 8.0.100
Operating system: Windows 11
The text was updated successfully, but these errors were encountered: