title: How to handle null in Entity Framework Core using FirstAsync?
body: <pre><code>  public async Task&lt;ParagemRegisto&gt; GetParagemRegistoOnGoingAsync(int registoId)
    {
          return await = _context.ParagensRegistos
              .Where(pr =&gt; pr.RegistoId == registoId &amp;&amp; pr.HoraFim == null)
              .FirstAsync();
    }
  </code></pre>
  
  <p>This causes a null reference exception when there's no records found. How can I make it so it returns null if that is the case?</p>