title: Handle Microsoft.EntityFrameworkCore.DbUpdateException -- "Entries" list is always empty
body: <p>I am using EF core 2.2(Sql server) and trying to handle DbUpdateException. 
  It is a console app done in .Net core.</p>
  
  <p>Exception generated by EF is: </p>
  
  <blockquote>
    <p>about one of non-nullable field being null during save</p>
  </blockquote>
  
  <p>To handle this i need to know which entities failed, so that i can log them and detach them from context as same context is used to save other records in loop setup but for my case; <strong><em>entries list is always empty when i get error</em></strong>.</p>
  
  <p><strong>Please refer image down:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/dqVws.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dqVws.png" alt="entries list is empty for failed entity save/update"></a></p>
  
  <p>I am following this link as this looked having good suggestions around handling same:</p>
  
  <p><a href="https://stackoverflow.com/questions/22490842/finding-the-reason-for-dbupdateexception">handle DbUpdateException</a></p>
  
  <p>Can anyone please share any documentation/directions/links around what all possible reasons are there behind having entries list 0 so that i can match/fix mine and get entries list loaded.</p>
  
  <p><strong>FYI</strong></p>
  
  <p>I am having solution designed in EF core 2.2 with generic repository and unit of work pattern if that matters in any ways. But i tried handling exception in all layers, unit of work, repository as well as overridden savechanges in context and all the places it comes empty.</p>
  
  <p><a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbupdateexception.entries?view=efcore-2.1" rel="nofollow noreferrer">Microsoft documentation</a> says this, but i don't find it detailed enough to fix for my scenario.</p>
  
  <blockquote>
    <p>Typically this is a single entry, but in some cases it may be zero or
    multiple entries</p>
  </blockquote>