title: How to use class object instead of using JObject in .NET Core
body: <p>I want to return C# class object instead of using JObject in here. Could someone can tell me how to use it.</p>
  <pre><code>private async Task&lt;JObject&gt; GetReceiptById(string Id, string name)
  {
      var response = await _ApiService.Get(Id, name);
      var responseStr = await response.Content.ReadAsStringAsync();
  
      if (response.IsSuccessStatusCode)
      {              
          return JObject.Parse(responseStr);
      }
  
      throw new Exception(responseStr);
  }
  </code></pre>
  <p><strong>this method is return (return JObject.Parse(responseStr)); below JSON output. for that how to create a new class. I am not sure how to apply all in one class.</strong></p>
  <pre><code>{
      &quot;receipts&quot;: [
          {
              &quot;ReceiptHeader&quot;: {               
                  &quot;Company&quot;: &quot;DHSC&quot;,
                  &quot;ErpOrderNum&quot;: &quot;730&quot;,                
                  &quot;DateTimeStamp&quot;: &quot;2022-05-14T13:43:57.017&quot;
              },
              &quot;ReceiptDetail&quot;: [
                  {
                      &quot;Line&quot;: 1.0,
                      &quot;ITEM&quot;: &quot;PP1016&quot;,                    
                      &quot;ITEM_NET_PRICE&quot;: 0.0
                  },
                  {
                      &quot;Line&quot;: 2.0,
                      &quot;ITEM&quot;: &quot;PP1016&quot;,                    
                      &quot;ITEM_NET_PRICE&quot;: 0.0
                  }
              ],
              &quot;XrefItemsMapping&quot;: [],
              &quot;ReceiptContainer&quot;: [],
              &quot;ReceiptChildContainer&quot;: [],
              &quot;rPrefDO&quot;: {
                  &quot;Active&quot;: null,
                  &quot;AllowLocationOverride&quot;: null,                
                  &quot;DateTimeStamp&quot;: null
              }
          }
      ]
  }
  </code></pre>