EntityCommandExecutionException equivalent in .net 5

Viewed 38

I had an .net framework 4.5 application that calls a lot of db functions and stored procedures. I was catching EntityCommandExecutionException (https://docs.microsoft.com/en-us/dotnet/api/system.data.entitycommandexecutionexception?view=netframework-4.5.2) in order to get custom errors returned by the database. We've migrated the app to .net 5, but I couldn't find the .net 5 equivalent. The best I could find is DbException (https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbexception?view=net-5.0). Is there a better equivalent in .net 5 that is not provider specific?

0 Answers
Related