title: Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call on ASP.NET core 2.2
body: <p>I'm using aspnetboilerplate solution developed with ASP.NET core 2.2 . The backend is deployed on azure and it uses the SQL server provided.</p>
  <p>Sometimes, when the backend has a lot of requests to handle, it logs this exception:</p>
  <blockquote>
  <p>Mvc.ExceptionHandling.AbpExceptionFilter - An exception has been
  raised that is likely due to a transient failure. Consider enabling
  transient error resiliency by adding 'EnableRetryOnFailure()' to the
  'UseSqlServer' call. System.InvalidOperationException: An exception
  has been raised that is likely due to a transient failure. Consider
  enabling transient error resiliency by adding 'EnableRetryOnFailure()'
  to the 'UseSqlServer' call. ---&gt; System.Data.SqlClient.SqlException: A
  transport-level error has occurred when receiving results from the
  serv</p>
  </blockquote>
  <p>I tried to solve this problem adding this code to my Startup.cs</p>
  <pre><code>public IServiceProvider ConfigureServices(IServiceCollection services)
          {
              // MVC
              services.AddMvc(
                  options =&gt; options.Filters.Add(new CorsAuthorizationFilterFactory(_defaultCorsPolicyName))
              ).AddJsonOptions(
              // To fix OldContract in Contract entity (self-referencing loop)
  
          services.AddDbContext&lt;ManagerDbContext&gt;(options =&gt;
          {
              options.UseSqlServer(_appConfiguration[&quot;ConnectionStrings:Default&quot;],
                  sqlServerOptionsAction: builder =&gt;
                  {
                      builder.EnableRetryOnFailure(
                          maxRetryCount: 10,
                          maxRetryDelay: TimeSpan.FromSeconds(30),
                          errorNumbersToAdd: null);
                  });
          });
  
      }
  </code></pre>
  <p>But the problem is not solved.</p>