title: Can I access a C# enum in my Razor view?
body: <p>I have the following:</p>
  
  <pre><code>namespace Storage.Constants.References {
      public enum RoleType {
          Guest = 1,
          User = 2,
          Admin = 3,
          Super = 4
      }
  }
  </code></pre>
  
  <p>In my web.config I added:</p>
  
  <pre><code>&lt;add namespace="Storage.Constants.References" /&gt;
  </code></pre>
  
  <p>However in my view below I still don't get any intellisense for the RoleType and it appears to not know what it is:</p>
  
  <pre><code>@model WebUx.ViewModels.BaseViewModel
  @{ Layout = "~/Views/Shared/_Layout.cshtml"; }
  @section status {
  
      @if (Model.Role &gt;= RoleType.Admin)
      {
  </code></pre>
  
  <p>However it works if I change this to:</p>
  
  <pre><code>@if (Model.Role &gt;= Storage.Constants.References.RoleType.Admin)
  </code></pre>
  
  <p>Should it not work without my specifying "Storage.Constants.References" ?</p>