AspNetCoreOData
AspNetCoreOData copied to clipboard
Fix duplicate JOIN statements when expanding an IQueryable that already has a join
Fixes https://github.com/OData/AspNetCoreOData/issues/1035
In this fix https://github.com/OData/AspNetCoreOData/pull/993 we added a fix to remove duplicate joins from the generated sql. This involved making updates to the Instance property of the expression to be created and only including structural properties.
The changes led to this being generated:
{ Instance = new Customer() {Id = $it.Id, Name= $it.Name}}
Instead of this:
{ Instance = $it }
These changes did not take into consideration query settings. I've added checks for nullability and handling null propagation and creating a conditional expression.