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

Records not supported in EF object initialization expressions #364

Closed
silkfire opened this issue Feb 28, 2024 · 2 comments
Closed

Records not supported in EF object initialization expressions #364

silkfire opened this issue Feb 28, 2024 · 2 comments

Comments

@silkfire
Copy link

In an EF Select clause, if the object is a record, the query fails with an exception that it can't be translated (something with ParameterQueryRootExpression).

When using anonymous objects or classes, things work as intended.

Repro:

await _dbContext.MyTable.Where(...).Select(m => new Record(m.Column1, m.Column2)).ToListAsync();
@alexkeh
Copy link
Member

alexkeh commented Feb 28, 2024

Does EF Core itself support records yet? Is there doc that indicates records support? See dotnet/efcore#11457 and dotnet/EntityFramework.Docs#4438

@silkfire
Copy link
Author

silkfire commented Mar 4, 2024

Thanks for the reply, I wasn't actually aware of that.

@silkfire silkfire closed this as completed Mar 4, 2024
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

No branches or pull requests

2 participants