title: return enum as string in asp.mvc and json
body: <p>I have a class that contains an <code>enum</code> property.</p>
  
  <p>my enum:</p>
  
  <pre><code> public enum ToasterType
      {
          [EnumMember(Value = "success")]
          success,
          [EnumMember(Value = "error")]
          error
      }
  </code></pre>
  
  <p>my class :</p>
  
  <pre><code>[Serializable]
      public class ToastrMessage
      {
          [JsonConverter(typeof(StringEnumConverter))]
          public ToasterType ToasterType { get; set; }
           // bla bla bla
      }
  </code></pre>
  
  <p>return class with Json :</p>
  
  <pre><code> public async Task&lt;ActionResult&gt; Authentication()
      {
           return Json(this.ToastrMessage(ToasterType.success));
      }
  </code></pre>
  
  <p>and output :</p>
  
  <p><a href="https://i.stack.imgur.com/GlnLX.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/GlnLX.jpg" alt="enter image description here"></a></p>
  
  <p>why <code>1</code> ?</p>
  
  <p>but i need something like below : </p>
  
  <pre><code>ToasterType: success
  </code></pre>