title: How to get exception code in C# catch block
body: <p>In the try catch block want to get the catch exception code, we know that 404: not found, 400: bad request. In my catch block want to get exception code. How to get exception code in C# catch block.</p>
  
  <pre><code> try
              {
                  await next(context);
              }
              catch (Exception ex)
              {
  
              }
  </code></pre>