Skip to content
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

Consolidate primitive collections across relational and Cosmos #33456

Merged
merged 3 commits into from
Apr 3, 2024

Conversation

ajcvickers
Copy link
Member

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

@ajcvickers ajcvickers requested a review from a team April 2, 2024 12:05
/// <typeparam name="TElement">The element type.</typeparam>
public sealed class ListComparer<TElement> : ValueComparer<IEnumerable<TElement>>
public sealed class ListComparer<TConcreteCollection, TElement> : ValueComparer<IEnumerable<TElement>>
where TElement : struct
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming this to ValueTypeListComparer

@AndriySvyryd
Copy link
Member

Add a nested primitive collection to CompiledModelTestBase.ManyTypes

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants