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

Cosmos: allow value converters for collections of primitive types #25343

Open
Tracked by #30731
AndriySvyryd opened this issue Jul 27, 2021 · 2 comments · Fixed by #33456
Open
Tracked by #30731

Cosmos: allow value converters for collections of primitive types #25343

AndriySvyryd opened this issue Jul 27, 2021 · 2 comments · Fixed by #33456

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Jul 27, 2021

See https://github.com/npgsql/efcore.pg/blob/main/src/EFCore.PG/Storage/ValueConversion/INpgsqlArrayConverter.cs for a way of implementing this.

Also try to use built-in converters automatically, see https://github.com/npgsql/efcore.pg/blob/main/src/EFCore.PG/Storage/ValueConversion/NpgsqlValueConverterSelector.cs

@ajcvickers
Copy link
Member

Note from triage: also consider other issues related to primitive collections--see label area-primitive-collections.

@ajcvickers
Copy link
Member

Note for team: either a duplicate of #4179, or already supported if the issue means using value converters explicitly.

@ajcvickers ajcvickers added this to the 9.0.0 milestone Mar 7, 2024
@ajcvickers ajcvickers assigned ajcvickers and unassigned AndriySvyryd Mar 7, 2024
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 2, 2024
ajcvickers added a commit that referenced this issue Apr 2, 2024
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 added a commit that referenced this issue Apr 3, 2024
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 modified the milestones: 9.0.0, 9.0.0-preview4 Apr 8, 2024
@ajcvickers ajcvickers reopened this Jul 28, 2024
@ajcvickers ajcvickers removed this from the 9.0.0-preview4 milestone Jul 28, 2024
@ajcvickers ajcvickers added this to the Backlog milestone Aug 12, 2024
@ajcvickers ajcvickers removed the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 21, 2024
@ajcvickers ajcvickers removed their assignment Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants