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

Scott: SmartEnum Implicit Value Conversion #7

Merged
merged 3 commits into from
Dec 7, 2017
Merged

Scott: SmartEnum Implicit Value Conversion #7

merged 3 commits into from
Dec 7, 2017

Conversation

sdepouw
Copy link
Collaborator

@sdepouw sdepouw commented Dec 6, 2017

Allows converting from SmartEnum<TEnum, TValue> to TValue. Useful for situations that crop up when using C# enum where you need the integer value.

private void SomeMethod(int enumValue) { }

// Elsewhere in code
SomeMethod(TestEnum.One); // Now you don't have to write TestEnum.One.Value

This is particularly useful when adapting legacy code, transforming enums into SmartEnums.

Also in this PR:

  • Root namespace of SmartEnum updated to match AssemblyName and namespace use in code.
  • using removal/sorting
  • whitespace fix

@ardalis ardalis merged commit 3f95408 into ardalis:master Dec 7, 2017
@sdepouw sdepouw deleted the scott/implicit-convert-value branch June 1, 2018 14:45
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