Entity Framework - SQL Azure Retry Policy

前端 未结 5 1417
春和景丽
春和景丽 2020-12-31 05:20

Could anyone guide me how to implement a retry policy with EF to SQL Azure, please.

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 05:57

    The problem with using the Transient Fault Handling library according to most of the documentation out there is that it forces you to wrap every database call in your application.

    If you use Entity Framework 6 (currently in alpha) then there is some new in-built support for transient retries with Azure SQL Database (with a little bit of configuration): here is the link

    I've created a library which allows you to configure Entity Framework to retry using the Fault Handling block without needing to change every database call - generally you will only need to change your config file and possibly one or two lines of code.

    This allows you to use it for Entity Framework or Linq To Sql, here is the link

提交回复
热议问题