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

Ensure converters and comparers are handled by type mapping #17962

Closed
AndriySvyryd opened this issue Sep 20, 2019 · 3 comments
Closed

Ensure converters and comparers are handled by type mapping #17962

AndriySvyryd opened this issue Sep 20, 2019 · 3 comments
Assignees
Labels
area-change-tracking closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-cleanup
Milestone

Comments

@AndriySvyryd
Copy link
Member

So we can change code like this:

property.GetValueComparer() ?? property.FindTypeMapping()?.Comparer
property.GetValueConverter() ?? property.FindTypeMapping()?.Converter

to just

property.FindTypeMapping()?.Comparer
property.FindTypeMapping()?.Converter
@smitpatel smitpatel added this to the Backlog milestone Sep 27, 2019
@ajcvickers
Copy link
Member

ajcvickers commented Oct 4, 2019

@AndriySvyryd Current design allows the value comparer to overridden without needing to replace the entire type mapping. This is useful, for example, to do case insensitive string comparisons.

@AndriySvyryd
Copy link
Member Author

Ok, but would it be that different if the type mapping was replaced (though since type mapping is done when the model is finalized there's nothing to replace)?
By grouping the same responsibilities into one class we improve cohesion and reduce error potential on usage.

@AndriySvyryd
Copy link
Member Author

@ajcvickers This was done for GetValueComparer, but not for GetValueConverter

@ajcvickers ajcvickers modified the milestones: MQ, Backlog Dec 16, 2020
@ajcvickers ajcvickers modified the milestones: Backlog, MQ Oct 20, 2021
@ajcvickers ajcvickers modified the milestones: MQ, 7.0.0 Apr 6, 2022
@ajcvickers ajcvickers added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed needs-design labels Apr 6, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, 7.0.0-preview4 Apr 18, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0-preview4, 7.0.0 Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-change-tracking closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-cleanup
Projects
None yet
Development

No branches or pull requests

3 participants