title: How to remove first and last square brackets from JSON from query string web api c#
body: <p>How to remove only response <code>SQUARE BRACKET FROM result</code> - response: <code>[]</code></p>
  
  <pre><code>public HttpResponseMessage GetDetail(int id)
      {
  
          var result = new Dictionary&lt;string, object&gt;();
          EDetail EDetailobj = db.EDetails.FirstOrDefault(P =&gt; P.DetailID == id);
          if (EDetailobj != null)
          {
              result.Add("Status", "ok");
  
              var responseResult = db.EDetails
                  .Where(x =&gt; x.DetailID == id)
                  .Select(x =&gt; new
                  {
                      x.DetailID ,
                      x.DetailName,
                      x.Qty,
                      x.Price,
                  });
              result.Add("Response", responseResult);
              return Request.CreateResponse(HttpStatusCode.OK, result);
          }
          else
          {
              result.Add("Status", "failure");
              return Request.CreateResponse(result);
          }
      }
  
  {
    "status": "ok",
    "response": [
      {
        "detailID": 1,
        "detailName": "whiteshirt",
        "qty": 12,
        "price": 21.0,
      }
    ]
  }
  </code></pre>