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

Generate KeyValueFactory and related instances in the compiled model. #33887

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

AndriySvyryd
Copy link
Member

Simplify the generated ValueComparers

@AndriySvyryd AndriySvyryd requested a review from a team June 3, 2024 22:19
@AndriySvyryd AndriySvyryd force-pushed the CompiledIdentity branch 2 times, most recently from e651dab to e24a704 Compare June 3, 2024 23:40
providerValueComparer: new ValueComparer<long>(
(long v1, long v2) => v1 == v2,
(long v) => ((object)v).GetHashCode(),
(long v) => v),
Copy link
Member

Choose a reason for hiding this comment

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

🍾

@@ -20,7 +20,7 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking;
/// </remarks>
/// <typeparam name="TConcreteCollection">The collection type to create an index of, if needed.</typeparam>
/// <typeparam name="TElement">The element type.</typeparam>
public sealed class ListOfReferenceTypesComparer<TConcreteCollection, TElement> : ValueComparer<object>
public sealed class ListOfReferenceTypesComparer<TConcreteCollection, TElement> : ValueComparer<object>, IInfrastructure<ValueComparer>
Copy link
Member

Choose a reason for hiding this comment

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

Looks great, but one question: is IInfrastructure<> the right thing to use here? It probably doesn't matter anyway, since it does the right thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't have the exact semantics, but it's close enough for me to avoid introducing another interface

@AndriySvyryd AndriySvyryd merged commit da10319 into main Jun 5, 2024
7 checks passed
@AndriySvyryd AndriySvyryd deleted the CompiledIdentity branch June 5, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants