title: Enum returning string value in WebAPI
body: <p>I have come across a piece of code in my Web API project, which has a class of this structure:</p>
  <pre><code>public class QuestionDto
  {
      public bool disabled {get;set;}
      public int id {get;set;}
      public int order {get;set;}
      public PositionDto pagePosition {get;set;}
      public string title {get;set;}
  }
  
  public enum PositionDto
  {
      FullWidth = 0,
      Half = 1
  }
  </code></pre>
  <p>There is an API call that returns <code>QuestionDto</code>, along the lines of:</p>
  <pre><code>[Route(&quot;&quot;)]
  [HttpGet]
  [ResponseType(typeof(QuestionDto))]
  public async Task&lt;IHttpActionResult&gt; GetCategoryQuestions()
  {
      return Ok(new QuestionDto { PagePosition = PagePositionDto.Half });
  }
  </code></pre>
  <p>Here is a snip from the Chrome console network tab showing the repsonse for this API call:</p>
  <p><a href="https://i.stack.imgur.com/ooULh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ooULh.png" alt="enter image description here" /></a></p>
  <p>How can the enum be returning its text value, rather than its int value?</p>
  <p>To confuse this even further, if I then take this same class structure and copy and paste to a differrent project, the api call returning this object will return the int value - which is what I would expect.</p>
  <p>So how can the first project be returning the string value?</p>
  <p>Is there some setting somewhere which can make this enum return its string value?</p>