title: Parsing mixed value enums (char and int)
body: <p>I have an oddball enum where some of the values are <code>char</code> and others <code>int</code>:</p>
  
  <pre><code>public enum VendorType{
      Corporation = 'C',
      Estate = 'E',
      Individual = 'I',
      Partnership = 'P',
      FederalGovernment = 2,
      StateAgencyOrUniversity = 3,
      LocalGovernment = 4,
      OtherGovernment = 5
  }
  </code></pre>
  
  <p>I'm yanking in some data from a text file that provides the symbol for this type (ex. <code>I</code> or <code>4</code>), and I use that to lookup the enum's hard typed value (ex. <code>VendorType.Individual</code> and <code>VendorType.LocalGovernment</code> respectively).</p>
  
  <p>The code i am using to do this is:</p>
  
  <pre><code>var valueFromData = 'C'; // this is being yanked from a File.IO operation.
  VendorType type;
  Enum.TryParse(valueFromData, true, out type);
  </code></pre>
  
  <p>So far so good when it comes to parsing the <code>int</code> values... but when I try to parse the <code>char</code> values the <code>type</code> variable doesn't parse and is assigned <code>0</code>.</p>
  
  <hr>
  
  <p><strong>Question:</strong> Is it possible to evaluate both <code>char</code> and <code>int</code> enum values? If so, how?</p>
  
  <p><strong>Note:</strong> I do not want to use custom attributes for assigning text values like I've seen in some other hack-ish examples online.</p>