title: JSON Response customize .NET Core Web API
body: <p>I'm making webapi using <code>.net core 2.2</code>. And I'm new to .net framework So far I was working with javascript based frameworks like nodejs expressjs. </p>
  
  <p>It's easy to customize JSON response in nodejs. Can you exaplain how to customize the JSON response with .NET Core 2.2  WebApi? Just point me to right direction.</p>
  
  <p>Let me give an example,</p>
  
  <p>C# User Model</p>
  
  <pre><code>public class User {
      int id {get;set;}
      string name {get;set;}
      string username {get;set;}
      string password {get;set;}
  }
  </code></pre>
  
  <p>Default API Get Reponse. </p>
  
  <pre><code>public ActionResult&lt;IEnumerable&lt;User&gt;&gt; GetAll()
  </code></pre>
  
  <p>Json:</p>
  
  <pre><code>[
      {
          "id":1,
          "name": "John Doe",
          "username": "john",
          "password": "AH7B302Iapxf7EFzZVW0/kJDuf/I3pDPkQ42IxBTakA="
      },
      {   
          "id":2,
          "name": "Jane Doe",
          "username": "jane",
          "password": "AH7B302Iapxf7EFzZVW0/kJDuf/I3pDPkQ42IxBTakA="
      }
  ]
  </code></pre>
  
  <p>I need to customize the output like this.</p>
  
  <pre><code>{
      "statuscode": 200,
      "count"     : 2,
      "data"      : 
  
      [
          {
              "name": "John Doe",
              "username": "john",
          },
          {
              "name": "Jane Doe",
              "username": "jane",
          }
      ]
  }
  </code></pre>