title: ASP.NET Web API Return JSON as an object
body: <p>Currently the Web API which queries the Oracle DB is returning the result in the JSON in the below format.</p>
  
  <pre><code>[{"CATEGORY":"Internal Study","SESSION_NUMBER":7,"SESSION_START_DATE":"2015-02-13T00:00:00","SESSION_START_TIME":"2015-02-13T10:33:59.288394"}]
  </code></pre>
  
  <p>Below is the code we are using </p>
  
  <pre><code>public class SampleController : ApiController
  {
    public HttpResponseMessage Getdetails([FromUri] string[] id)
     {
       using (OracleConnection dbconn = new OracleConnection("DATA SOURCE=J;PASSWORD=C;PERSIST SECURITY INFO=True;USER ID=T"))
        {
       var inconditions = id.Distinct().ToArray();
      var srtcon = string.Join(",", inconditions);
      DataSet userDataset = new DataSet();
      var strQuery = @"SELECT * from STCD_PRIO_CATEGORY where STPR_STUDY.STD_REF IN(" + srtcon + ")";
      OracleCommand selectCommand = new OracleCommand(strQuery, dbconn);
      OracleDataAdapter adapter = new OracleDataAdapter(selectCommand);
      DataTable selectResults = new DataTable();
      adapter.Fill(selectResults);
      var response = Request.CreateResponse(HttpStatusCode.OK, selectResults,MediaTypeHeaderValue.Parse("application/json"));
      ContentDispositionHeaderValue contentDisposition = null;
      if (ContentDispositionHeaderValue.TryParse("inline; filename=ProvantisStudyData.json", out contentDisposition))
      {
         response.Content.Headers.ContentDisposition = contentDisposition;
      }
      return response;
   }
  }
  </code></pre>
  
  <p>But the Client which has the Script which consumes the file says that JSON structure being an array instead of an object is a security hole. </p>
  
  <pre><code>  {"data":[{"CATEGORY":"Internal Study","SESSION_NUMBER":7,"SESSION_START_DATE":"2015-02-13T00:00:00","SESSION_START_TIME":"2015-02-13T10:33:59.288394"}]}
  </code></pre>
  
  <p>I am new to this JSON structure and not sure how we will be manipulate the returned data as an object in JSON File</p>