Skip to main content
added 205 characters in body
Source Link
Seb Nilsson
  • 26.5k
  • 31
  • 107
  • 131

Cast it to an int and then back to the other Enum.

public void SystemPersonTitles TellWhatYouAre(PersonTitle personTitle){ int value = (int)personTitle; var systemPersonTitle = (SystemPersonTitles)value; } 

Can also be done directly, as others point out, but I wanted to be explicit to show the mechanics behind the solution.

SystemPersonTitles systemPersonTitle = (SystemPersonTitles)personTitle; 

Cast it to an int and then back to the other Enum.

public void SystemPersonTitles TellWhatYouAre(PersonTitle personTitle){ int value = (int)personTitle; var systemPersonTitle = (SystemPersonTitles)value; } 

Cast it to an int and then back to the other Enum.

public void SystemPersonTitles TellWhatYouAre(PersonTitle personTitle){ int value = (int)personTitle; var systemPersonTitle = (SystemPersonTitles)value; } 

Can also be done directly, as others point out, but I wanted to be explicit to show the mechanics behind the solution.

SystemPersonTitles systemPersonTitle = (SystemPersonTitles)personTitle; 
Source Link
Seb Nilsson
  • 26.5k
  • 31
  • 107
  • 131

Cast it to an int and then back to the other Enum.

public void SystemPersonTitles TellWhatYouAre(PersonTitle personTitle){ int value = (int)personTitle; var systemPersonTitle = (SystemPersonTitles)value; }