title: How to read enum int value (without converting via cast) in C#?
body: <p>I had the following: </p>
  
  <pre><code>public enum SearchSex {
      All = 0,
      Male = 1,
      Female = 2,
      Other = 3
  }
  </code></pre>
  
  <p>Now I have this, to allow for Flags and bitmasking: </p>
  
  <pre><code>public enum SearchSex {
      All = 1,
      Male = 2,
      Female = 4,
      Other = 8
  }
  </code></pre>
  
  <p>In production,  I want all of the settings to remain the same as we make this update.  So I have a script that is doing the following: </p>
  
  <pre><code>// for each user:  
  user.SearchSex= (SearchSex)(Math.Pow(2, (Convert.ToInt32(user.SearchSex) - 1)));
  </code></pre>
  
  <p>I was thinking the Convert.ToInt32 would return the (old) actual integer value from the database, but it's trying to map the integer value to those (new) defined in the Enum definition.  How do I go about reading the raw integer value as it is, even if there is no longer any corresponding Enum value defined?  </p>