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

feat: Implement IEquatable in EmailAddress #905

Merged
merged 6 commits into from
Apr 11, 2020
Merged

feat: Implement IEquatable in EmailAddress #905

merged 6 commits into from
Apr 11, 2020

Conversation

aevitas
Copy link
Contributor

@aevitas aevitas commented Jul 4, 2019

Fixes #425

This pull request enables use of Distinct() et. al. on email addresses, allowing users to easily ensure no duplicate recipients exist, for instance when pulling recipients from a data source.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the development branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

  • Implement IEquatable<EmailAddress> in EmailAddress
  • Allows use of LINQ methods such as Distinct() on lists of e-mail addresses

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Jul 4, 2019
@aevitas
Copy link
Contributor Author

aevitas commented Jul 10, 2019

I just realised that this PR lacks the implementation of the equality operators as per the IEquatable documentation

@aevitas
Copy link
Contributor Author

aevitas commented Jul 14, 2019

I just realised that this PR lacks the implementation of the equality operators as per the IEquatable documentation

I've just finished implementing these. @thinkingserious PTAL.

Copy link
Contributor

@RodgerLeblanc RodgerLeblanc left a comment

Choose a reason for hiding this comment

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

Looks good to me

@childish-sambino
Copy link
Contributor

Fixed the stack overflow issue and equality logic to only check the email address and make it case-insensitive per comment here: #425 (comment)

@childish-sambino childish-sambino added the type: community enhancement feature request not on Twilio's roadmap label Apr 9, 2020
@childish-sambino childish-sambino changed the title Implement IEquatable in EmailAddress feat: Implement IEquatable in EmailAddress Apr 9, 2020
@childish-sambino childish-sambino merged commit d887004 into sendgrid:master Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impement IEquatable on EmailAddress to Filter Duplicates
4 participants