title: Go from nullable to non-nullable after ReadFromJsonAsync
body: <p><code>ReadFromJsonAsync</code> method returns nullable T. Here is a code sample:</p>
  <pre><code>private async Task&lt;T&gt; Get&lt;T&gt;(Uri url, CancellationToken cancellationToken)
  {
      using HttpResponseMessage response = await _httpClient.GetAsync(url, cancellationToken);
  
      T? body = await response.Content.ReadFromJsonAsync&lt;T&gt;(cancellationToken: cancellationToken);
  
      return body ?? throw new Exception();
  }
  </code></pre>
  <p>I want my method to return non-nullable value.</p>
  <p>I am wondering when <code>ReadFromJsonAsync</code> will return null. No matter how I have tried I was still getting instance of T with all properties equal null. So I hoped that it would be safe to write code like this:</p>
  <pre><code>    return (T)body;
  </code></pre>
  <p>But now I am getting a warning <strong>Converting null literal or possible null value to non-nullable type.</strong></p>
  <p>What about this, is it a good idea:</p>
  <pre><code>    return body!;
  </code></pre>