oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
408 stars 190 forks source link

Records not supported in EF object initialization expressions #364

Closed silkfire closed 4 months ago

silkfire commented 4 months ago

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 commented 4 months ago

Does EF Core itself support records yet? Is there doc that indicates records support? See https://github.com/dotnet/efcore/issues/11457 and https://github.com/dotnet/EntityFramework.Docs/issues/4438

silkfire commented 4 months ago

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