title: Does an enum ALWAYS need to be cast in c# if used as a method parameter?
body: <p>When using an enum as a parameter in a method call, must I cast it to the parameters defined type?</p>
  
  <p>The last 2 lines of code show the exact same method call, except one is cast to an int, the other is not. What should the outcome of these 2 lines be?</p>
  
  <p>Note in my example that the file that includes the enum is a .cs file, the other (poorly written here) is an aspx.cs file. I don’t think it should matter at all, but maybe it does.</p>
  
  <p>Thank you!</p>
  
  <pre><code>**fileOne.cs**
  [Imported]
  public class Foo
  {
      [Imported]
      public class Bar
      {
          [Imported]
          [PreserveCase]
          public enum Bam
          {
              [PreserveCase]
              Low = 10,
              [PreserveCase]
              Medium = 50,
              [PreserveCase]
              High = 100
          }
      }
      …code…
      [PreserveCase]
      public static void someMethod(string aString, int aNumber) {}
      …code…
  }
  
  **fileTwo.aspx.cs**
  …code…
  
  string someStuffForJscript = @”
  function afunction(doesntMatter)
  {{
      Foo.Bar.someMethod(""This is a string."", (int)Foo.Bar.Bam.Medium);
      Foo.Bar.someMethod(""This is a string."", Foo.Bar.Bam.Medium);
  }}
  </code></pre>
  
  <p>*This is oversimplified code, but the concept remains. there are numerous reasons beyond what you see here as to why an enum is used.</p>