title: Get Enum type from value
body: <pre><code>public enum WeekDays { Sun = 1, Mon = 2, Tue=3, Wed=4, Thu=5, Fri=6, Sat=7 }
  </code></pre>
  
  <p>I have this enum, I have the value of the enum. what I want to do is by passing value get the type that I want to pass this to below function. I can do this by switch case any better ways??</p>
  
  <p>for Example : value is 6 then Weekdays.Fri as a type should be passed to the below  function.</p>
  
  <pre><code>  public void CreateNew(WeekDays days)
    {
     //Some logic
    }
  </code></pre>