Skip to content

Conversation

@leandromoh
Copy link
Owner

@leandromoh leandromoh commented Nov 21, 2021

when enum is not a "simple" value in enum...

reading

  • before: throw exception
  • after: call Enum.Parse of .NET

writing

  • before: format/serialize value as interger
  • after: call ToString of .NET

this way we guarantee that for weird/corner cases everything still works as expected while maintaining code still optimized for "simple" values of enum (most common use).

@leandromoh leandromoh changed the title use fallback use Enum.Parse as fallback Nov 21, 2021
@leandromoh leandromoh changed the title use Enum.Parse as fallback use Enum.Parse and ToString methods as fallback for read/write Dec 18, 2021
@leandromoh leandromoh merged commit e786cf1 into master Dec 18, 2021
@leandromoh leandromoh deleted the adjust/enum-fallback branch December 18, 2021 21:15
@leandromoh leandromoh mentioned this pull request Dec 19, 2021
10 tasks
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