Skip to content

[Feature] Improve the conversion and comparison logic in IsEqualStateTrigger #3681

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

Closed
huoyaoyuan opened this issue Jan 21, 2021 · 1 comment · Fixed by #3678
Closed

[Feature] Improve the conversion and comparison logic in IsEqualStateTrigger #3681

huoyaoyuan opened this issue Jan 21, 2021 · 1 comment · Fixed by #3678
Labels
Completed 🔥 feature request 📬 A request for new changes to improve functionality helpers ✋ improvements ✨
Milestone

Comments

@huoyaoyuan
Copy link
Contributor

Describe the problem this feature would solve

Currently IsEqualStateTrigger can handle many cases, but code paths for them are not optimal.

Comparing two value types will fail with == which is ReferenceEquals, and fallback to conversion route.
Comparing enum with string will throw an exception, then successes with Convert.ChangeType to change enum to string.
Enum.IsDefined won't accept flags combinations.

Describe the solution

Refine the conversion and comparison logic.
Add unit test.

@huoyaoyuan huoyaoyuan added the feature request 📬 A request for new changes to improve functionality label Jan 21, 2021
@ghost
Copy link

ghost commented Jan 21, 2021

Hello, 'huoyaoyuan! Thanks for submitting a new feature request. I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future!

@ghost ghost added the In-PR 🚀 label Jan 21, 2021
@michael-hawker michael-hawker added this to the 7.0 milestone Mar 1, 2021
@ghost ghost added Completed 🔥 and removed In-PR 🚀 labels Mar 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Completed 🔥 feature request 📬 A request for new changes to improve functionality helpers ✋ improvements ✨
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants