Skip to content

Conversation

@ajcvickers
Copy link
Contributor

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

3 participants