title: Get data as JSON in controller
body: <p>I have this Ajax:</p>
  
  <pre><code>$.ajax({
          url: "/api/Values",
          dataType: "json",
          type: "POST",
          contentType: 'application/json; charset=utf-8',
          data: JSON.stringify({
              Id: "1", Name: "Name1", Family: "Family1"
          }),
  </code></pre>
  
  <p>No I want to get <code>data</code> in controller so that I can save it to a text file with log4net. Currently I have written this code:</p>
  
  <pre><code>public void PostValues(Class1 cs)
      {
          var data = $"Id = {cs.Id}, Name = {cs.Name}, Family = {cs.Family}";
          Log.Debug($"POST Request, value = {data}");
      }
  </code></pre>
  
  <p>With model binding I can get data that is bound to class properties like above and then combine them like above. But I don't want to use this way because I have to go through all class properties. Is there any way to get data posted to controller as JSON? I'm sure that should be a way to get the following line in the controller:</p>
  
  <pre><code>Id: "1", Name: "Name1", Family: "Family1"
  </code></pre>