1

I have a DbContext configured using options.UseSqlServer(). I have a few dozen stored procedure calls defined in the DbContext. They all look something like this:

await Database.ExecuteSqlRawAsync("exec dbo.spDoMyVeryTailoredProcedure");

None of them arrive in the execution strategy Execute or ExecuteAsync methods. This prevents all errors produced in stored procedures from being handled by the execution strategy's resiliency logic and explicit logging instructions.

Is there a way to properly inject error handling into these SQL executions?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nomenator
  • 1,021
  • 1
  • 13
  • 28
  • Have a look at [EF Core handling index violation best practices](https://stackoverflow.com/questions/71886960/ef-core-handling-index-violation-best-practices). – Qing Guo Jul 18 '23 at 03:27

0 Answers0