title: Why does Enum.Parse() return object?
body: <p>There's lots of questions on here about converting strings to an enum value.  Generally, the answer looks something like the answers on <a href="https://stackoverflow.com/q/16100/298754">this question</a>:</p>
  
  <pre><code>StatusEnum MyStatus = (StatusEnum) Enum.Parse( typeof(StatusEnum), "Active", true );
  </code></pre>
  
  <p>While that's a perfectly reasonable answer, and you can write a method to simplify the call, it doesn't answer the question of <strong>why</strong> Enum.Parse() returns an <code>object</code> instead of the appropriate enum value.  Why do I have to cast it to <code>StatusEnum</code>?</p>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>Basically, the question is why is a function like this not part of the Enum class?</p>
  
  <pre><code>    public static T Parse&lt;T&gt;(string value) where T: struct 
      {
          return (T)Enum.Parse(typeof (T), value);
      }
  </code></pre>
  
  <p>This function works perfectly fine, does exactly what you'd expect.  <code>StatusEnum e = Enum.Parse&lt;StatusEnum&gt;("Active");</code>. </p>