title: Is it possible to cast integer to enum?
body: <p>I got the following enum:</p>
  
  <pre><code> public enum detallistaDocumentStatus {
  
      /// &lt;remarks/&gt;
      ORIGINAL,
  
      /// &lt;remarks/&gt;
      COPY,
  
      /// &lt;remarks/&gt;
      REEMPLAZA,
  
      /// &lt;remarks/&gt;
      DELETE,
  }
  </code></pre>
  
  <p>then I got a class property of type detallistaDocumentStatus:</p>
  
  <pre><code> public detallistaDocumentStatus documentStatus {
          get {
              return this.documentStatusField;
          }
          set {
              this.documentStatusField = value;
          }
      }
  </code></pre>
  
  <p>In the real life the user will send us a number (1, 2, 3 or 4) representing each enum value in the order they are declared.</p>
  
  <p>so, is it possible to cast like this? </p>
  
  <pre><code>det.documentStatus = (detallistaDocumentStatus)3;
  </code></pre>
  
  <p>if not, how could I get the enum value using an integer as an index, we are using a lot of enums, so we want to do something generic and reusable</p>