title: Turn C# object to json string, how to handle double quotation
body: <p>I'm using Newtonsoft.Json to parse object to json string. It returns somethink like this:</p>
  
  <pre><code>{\"code\":-1,\"idName\":\"empty\",\"idValue\":0,\"message\":\"Failed,can not read object from body\"}
  </code></pre>
  
  <p>it is not a valid json string i think, anyone can work me out?</p>
  
  <p>What I want is something like this:</p>
  
  <pre><code>{"code":-1,"idName":"empty\",\"idValue\":0,\"message\":\"Failed,can not read object from body\"}  
  </code></pre>
  
  <p></p>
  
  <pre><code>public static class CommonUtility
  {
      // format response string
      public static string FormatResponseString(int code, string idName, long idValue, string message)
      {
          ResponseString rs = new ResponseString();
          rs.code = code;
          rs.idName = idName;
          rs.idValue = idValue;
          rs.message = message;
  
          string json = JsonConvert.SerializeObject(rs);
          return json;
      }
  }
  
  public class ResponseString
  {
      public int code;
      public string idName;
      public long idValue;
      public string message;
  }
  </code></pre>
  
  <p>EDIT: this is actual json from the response fidder TextView I can see:</p>
  
  <pre><code>"{\"code\":-1,\"idName\":\"empty\",\"idValue\":0,\"message\":\"Failed,can not read object from body\"}"
  </code></pre>
  
  <p>the scenario is this:
  I put the serialized json string in web api CreateResponse method. I can see the response string in fidder like I said in the question which is not valid json</p>
  
  <pre><code>Request.CreateResponse(HttpStatusCode.Created, returnString);
  </code></pre>
  
  <p><code>returnString</code> is json string from the serialized  <code>ResponseString</code> object</p>
  
  <p>I donot think it is a valid string , am I wrong?</p>