-
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
Use EF8-style primitive collections in the Cosmos provider #25364
Comments
When doing this, decide on how to deal with readonly collections (see #25344 (comment)). |
Consider read-only collections of mutable types (nested collections) |
Another provider that seems to support arrays which could benefit from this: https://github.com/cloudspannerecosystem/dotnet-spanner-entity-framework |
Related to #17471 |
Design decision: we need to as part of the relational primitive collections work (#30731). Collection properties will use the value converter by default; where not appropriate (because the collection is huge), users can disable it. Note: special-case .NET immutable collections such as ImmutableList; for these we don't need to snapshot, and the collection only changed if the reference changed (these types are particularly well-suited for change tracking). |
Necessary for primitive collection, where e.g. the comparer has type IList<int> but the type mapping is for the concrete List<int>. Related to/part of dotnet#25364
Note: see the new implementation of the collection comparers in 8.0.0-preview4. Note that this restricts to IList only, and not to ISet as discussed in the design meeting, because of the difficulty to (efficiently) compare two sets using (EF's) element comparer. |
Necessary for primitive collection, where e.g. the comparer has type IList<int> but the type mapping is for the concrete List<int>. Related to/part of #25364
Note for triage: #31480 added comparers for primitive collections, but these don't yet support nested collections. We should re-work them to do so, and then the Cosmos comparers can be removed. |
Related to #4179 |
This change starts using the EF8 primitive collection infrastructure for primitive collections in Cosmos. This involves adding support for nested collections and read-only collections. The main challenge here is supporting all the different collection types when, for example, `List<List<string>>` cannot be cast to `IEnumerable<IEnumerable<string>>`. To support this, we use exact collection types in snapshots, and we use non-generic methods in the nested comparers and serializers. General dictionary mapping still not supported. No extensive query testing done yet. Model building and change tracking for #30713 Fixes #25364 Fixes #25343 Part of #4179 Fixes #31722
This change starts using the EF8 primitive collection infrastructure for primitive collections in Cosmos. This involves adding support for nested collections and read-only collections. The main challenge here is supporting all the different collection types when, for example, `List<List<string>>` cannot be cast to `IEnumerable<IEnumerable<string>>`. To support this, we use exact collection types in snapshots, and we use non-generic methods in the nested comparers and serializers. General dictionary mapping still not supported. No extensive query testing done yet. Model building and change tracking for #30713 Fixes #25364 Fixes #25343 Part of #4179 Fixes #31722
* Consolidate primitive collections across relational and Cosmos This change starts using the EF8 primitive collection infrastructure for primitive collections in Cosmos. This involves adding support for nested collections and read-only collections. The main challenge here is supporting all the different collection types when, for example, `List<List<string>>` cannot be cast to `IEnumerable<IEnumerable<string>>`. To support this, we use exact collection types in snapshots, and we use non-generic methods in the nested comparers and serializers. General dictionary mapping still not supported. No extensive query testing done yet. Model building and change tracking for #30713 Fixes #25364 Fixes #25343 Part of #4179 Fixes #31722 * Remove dead files * Updates based on review feedback
These could be useful for other providers, not just Cosmos:
ListComparer
,NullableListComparer
,SingleDimensionalArrayComparer
,NullableSingleDimensionalArrayComparer
,StringDictionaryComparer
,NullableStringDictionaryComparer
The text was updated successfully, but these errors were encountered: