efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Json/Query: translate element access of a json array

Open maumar opened this issue 2 years ago • 1 comments

Something like:

entity.Where(x => x.JsonCollection[0].NestedReference.Name != "Foo")

When done in projection, this breaks the ordinal key logic, so we need to force AsNoTracking for these queries.

We could maybe utilize json de-duplication logic when the owner is present. For now de-dup is only working on navigation names, would need to incorporate array indexes also.

i.e.

entity.Select(x => new { x, ArrayAccess = x.JsonCollection[0] })

maumar avatar Aug 10 '22 01:08 maumar

Same as #25701 (for Cosmos). We should think if there's some way to evolve the two together.

roji avatar Aug 10 '22 08:08 roji