title: Can I user Enums inside my Razor views?
body: <p>I have the following Enum:</p>
  
  <pre><code>namespace Storage.Constants.References { 
      public enum RoleType {
          Guest = 1,
          User = 2,
          Admin = 3,
          Super = 4
      } 
  }
  </code></pre>
  
  <p>The following viewmodel:</p>
  
  <pre><code>public class   BaseViewModel
  {
      public int Role { get; set; }
  }
  </code></pre>
  
  <p>In my code I have the following. Note that the Enum is recognized by the code. </p>
  
  <pre><code>@if (Model.Role &gt;= RoleType.Admin) {
     xx
  }
  </code></pre>
  
  <p>My code fails at runtime with the following message:</p>
  
  <p>error CS0019: Operator '>=' cannot be applied to operands of type 'int' and 'Storage.Constants.References.RoleType'</p>