Open Quietscheente opened 1 month ago
What EF provider are you using (the stacktrace seems to point to SqlServer?) and what version?
Does the problem go away if you just switch the EF configuration to a single-table mapping?
SqlServer 8.0.6
If I remove public string? Description { get; set; }
from class Test
and the .SplitToTable
it works fine.
[EDIT] Even with expands like:
/test?$expand=ParentNavigation($expand=TestDescription),TestDescription
Assemblies affected
ASP.NET Core OData 8.2.5 Microsoft.EntityFrameworkCore 8.0.6 [EDIT] SqlServer 8.0.6
Describe the bug
In combination with EF and SplitToTable I get an error "System.InvalidOperationException: Sequence contains more than one element". The error is in EF, so I'm not 100% sure if it is an oData or EF problem. But I tried to reproduce the problem with a hand made linq EF query that returns equivalent results (like
dbContext.Tests.Include(t => t.ParentNavigation)
) that oData returns and everything works fine. I can't reproduce the bug without oData. So I hope I'm in the right place.error is:
Reproduce steps
db.Set<Test>().AsNoTracking();
asActionResult<IQueryable<Test>>
for GETData Model
EDM (CSDL) Model
Additional context
I also tried
/test?$expand=InverseParentNavigation
and everything works fineCreateTables.txt