Skip to content

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