-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Json: add support for collection of primitive types inside JSON columns #28688
Comments
Note from triage: also consider other issues related to primitive collections--see label |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Note: similar to this, we could allow weakly-typed mapping via Dictionary as well (see #29825). |
I have a working prototype for this from a few years back for .EF5 - should I see if I can resurrect it for EF7 ? |
@Soundman32 this tracks support specifically inside the new EF 7 JSON columns feature, so I'm guessing any work on EF 5 would need serious adjustment in order to be relevant. But you can always take a look. |
@roji My prototype was purely for the Cosmos driver, so it might not be quite as simple as I first thought, but I'll have a go :-) |
Is this why |
@Elrenarch that sounds like a bug - can you please open a separate issue with a minimal, runnable code sample? |
Done - #30707 |
SEE COMMENT BELOW FIRST @maumar this was also done as part of #30738... We have some basic testing there specifically for when the primitive collection is inside an owned JSON entity (calling Count, indexing), though at least in principle it shouldn't matter whether the collection is inside or not (see conversation #30738 (comment)). If we do decide to add more coverage, better to add a JSON owned entity to PrimitiveCollectionsTestBase with some tests on that, and remove Column_collection_inside_json_owned_entity from NonSharedPrimitiveCollectionsQueryRelationalTestBase. Am leaving this issue open for a bit - let me know what you think, the basic testing we already have may be enough. |
Ah no, there's a problem with the way things currently are: the primitive collection is integrated as a string inside the larger owned entity JSON document, instead of as an in-line JSON array. For example, looking at the
i.e. the document contains a string value, which itself encodes an array inside. Instead, it should be:
So we still have a bit of work here. |
I think what needs to happen is something like the following:
This is all better handled after we do the move to the lower-level Utf8JsonReader/Writer APIs (#30604), and after the type mapping APIs are introduced (#30677) |
There is numerous issues on json collection/dictionary support to a point that it's not clear what is exactly supported or not and at what verison. Is there any docs / samples that detail this? Thanks. |
No description provided.
The text was updated successfully, but these errors were encountered: