title: Cast enum to integer
body: <p>I have an enum class called <code>Gender</code>, and I have values in this like:</p>
  
  <pre><code>public enum GENDER
  {
      MALE = 1,
      FEMALE = 2,
      OTHERS = 3,
  }
  </code></pre>
  
  <p>And in my business object I just created a property for this, like:</p>
  
  <pre><code>public GENDER Gender
  {
    get
    { 
        return gender; 
    }
    set 
    {
        gender = value; 
    }
  }
  </code></pre>
  
  <p>In my database it's in type <code>integer</code>. For this I tried to assign the <code>Gender</code> value in the add function by its name <code>Gender</code>. But it's showing an error. Is it possible to cast the enum to integer so that it'll get the value automatically.</p>
  
  <p>How can I fix this?</p>