title: how to have Web Api send Json.net Serialized string object back to client Correctly?
body: <p>I am serializing an IEnumerbale object using JsonConvert.SerializeObject( );
  it produces string with quotes and escape character with spaces</p>
  
  <p>from web Api controller i return that string  using code below</p>
  
  <pre><code>[HttpGet]
  public string GetDegreeCodes(int id)
  {
      string result = //output from JsonConvert.SerializeObject( );
      return result;
  }
  </code></pre>
  
  <blockquote>
    <p>"[{\"DegreeId\":1,\"DegreeName\":\"High School\",\"ImageSrc\":\"
    <a href="http://bootsnipp.com/apple-touch-icon-114x114-pre">http://bootsnipp.com/apple-touch-icon-114x114-pre</a>\",\"Description\":\"
    Get High School
    Degree\r\"},{\"DegreeId\":2,\"DegreeName\":\"Associate\",\"ImageSrc\":\"
    <a href="http://bootsnipp.com/apple-touch-icon-114x114-pre">http://bootsnipp.com/apple-touch-icon-114x114-pre</a>\",\"Description\":\"
    Get Associate
    Degree\r\"},{\"DegreeId\":3,\"DegreeName\":\"Bachelor\",\"ImageSrc\":\"
    <a href="http://bootsnipp.com/apple-touch-icon-114x114-pre">http://bootsnipp.com/apple-touch-icon-114x114-pre</a>\",\"Description\":\"
    Get Bachelor
    Degree\r\"},{\"DegreeId\":4,\"DegreeName\":\"Masters\",\"ImageSrc\":\"
    <a href="http://bootsnipp.com/apple-touch-icon-114x114-pre">http://bootsnipp.com/apple-touch-icon-114x114-pre</a>\",\"Description\":\"
    Get Master
    Degree\r\"},{\"DegreeId\":5,\"DegreeName\":\"Doctrate\",\"ImageSrc\":\"
    <a href="http://bootsnipp.com/apple-touch-icon-114x114-pre">http://bootsnipp.com/apple-touch-icon-114x114-pre</a>\",\"Description\":\"
    Get Doctorate Degree\"}]"</p>
  </blockquote>
  
  <p><strong>This is my ajax and it does not recognize the JSON correctly because of the extra wrapper quotes and escape characters,</strong> </p>
  
  <pre><code>$.ajax({
          url: "/api/helloservice/getdegreecodes",
          type: "get",
          contentType: "application/text",
          data: { id: 1 }
      }).done(function (data) {
          if (data.length &gt; 0) {
  
              for (i = 0; i &lt; data.length; i++) {
                  viewEduModel.degreeCodes.push(data[i]);
              }
  
          }
      });
  </code></pre>
  
  <blockquote>
    <p>i need to use JsonConvert.SerializeObject since i am caching it as a JSon
    in my redis cache server using booksleeve that way I do not need to
    re serialize and read from db every time.  how do i avoid web api controller sending
    Quotes and backslashes? i could simply return IEnumerable and
    let Web Api do the JSOn serialization but i need to cache it on redis
    side</p>
  </blockquote>