Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to design enums for extensibility

$
0
0

Let's assume I have enum

enum Gender
{
   Male,
   Female,
   Shemale,
   Other
}

Now assume I already have database using this enum and I want to add more fields. In C languages it is common to design enums like that:

enum Gender
{
   Male,
   Female,
   Shemale,
   Reserved1,
   Reserved2,
   Reserved3,
   Reserved4,
   Other
}

How to do it right?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>