title: How do I convert an enum to a list and replace '_' with ' ' (space)
body: <p>I have a enum as:-</p>
  
  <pre><code>    public enum EnumType
      {
          Type1_Template,
          Type2_Folders,
          Type3_Template,
          Type1_Folders,
      }
  </code></pre>
  
  <p>Now, in my Controller i want </p>
  
  <ol>
  <li>List of Enum and </li>
  <li>Replace the _ underscores with space.</li>
  </ol>
  
  <p>So for that :-
  Getting List of Enum i have </p>
  
  <pre><code>return new Models.DTOObject()
              {
                  ID = model.id,
                  Name = model.Name,
                  Description = model.Description,
                  //Type is the property where i want the List&lt;Enum&gt; and replace the underscore with space
                  Type = Enum.GetValues(typeof(EnumType)).Cast&lt;EnumType&gt;().ToList()
              };
  </code></pre>
  
  <p>But now, i am trying something like this (may sound weird though ):-</p>
  
  <pre><code>return new Models.Customers()
              {
                  ID = model.id,
                  Name = model.Name,
                  Description = model.Description,
                  //Type is the property where i want the List&lt;Enum&gt; and replace the underscore with space
                  Type = Enum.GetValues(typeof(EnumType)).Cast&lt;EnumType&gt;().ToList().Select(e =&gt; new
                  {
                      Value = e,
                      Text = e.ToString().Replace("_", " ")
                  })
              };
  </code></pre>
  
  <p>but throws syntax errors(';' missing ). Though it was just hit an try kind of stuff. Please let me know how can i achieve it.</p>