title: How do you retrieve the Exception number from DbUpdateException in Asp.net 5
body: <p>I'd rather not do string comparison and it looks like my exeption number is in the InnerExeption number field but I get build errors if I try to access it directly. </p>
  
  <pre><code>try {
      db.SaveChanges();
  } catch (Microsoft.Data.Entity.DbUpdateException ex) {
      // ex.InternalException.Number won't compile but appears to be there
  
      // ex.InternalException.Message does compile but I think it seems less clean than a const comparison
  }
  </code></pre>
  
  <p>Once I do get the number is there a const I can compare it with? I'm trying to check for duplicate key error.</p>
  
  <p>Thanks</p>