Open roji opened 1 year ago
@roji I'm sorry to bother you, I found that builder.OwnsMany(x => x.ListOfStructsProperty, x => x.ToJson());
doesn't work on net8.0 and I didn't find the issue to track. Should I create it or the issue is already here somewhere?
@AndriySvyryd do we have an issue already tracking this? I found #28861 but that seems to be something else (am still not sure exactly what though 😅 )
In any case, we're likely to work on mapping JSON through complex types (as opposed to owned entities), and should make that work there - JSON mapping via owned entity types is likely to be de-prioritized.
@vchirikov ~Mapping owned collections to JSON is generally supported. Can you open a new issue that shows the types being mapped, the error that you get and how you expect the JSON to look?~
Oh, I see now. We only allow structs to be mapped as complex types. So as @roji mentioned, be on the lookout for #31252 and #31411
Do you have any suggestions for implementing a List<List< int>>? since it doesn't work with OwnsMany either.
@zN3utr4l nested primitive collection support is tracked by #30713 - that's not currently supported.
This user story tracks support for primitive collections, i.e. the ability to map a property of type
int[]
to the database, as a JSON array (by default). Where supported, such collections are also fully queryable via the regular LINQ operators.As a by-product of this, the translation for
intParam.Contains(b => b.Property)
would be changed from the current IN with constants translation to a string parameter containing an JSON array, which would be unpacked at the database and queried via the standard means. This resolves #13617, which is a long-standing, highly-voted performance issue.Done in 8.0
Done in 9.0
Backlog
Related issues