title: Transient Failure handling in .net core 2.1 MVC for MySQL Database
body: <pre><code>services.AddDbContext&lt;MyContext&gt;(options =&gt;
  {
      options.UseSqlServer(mysqlConnection,
      sqlServerOptionsAction: sqlOptions =&gt;
      {
          sqlOptions.EnableRetryOnFailure(
          maxRetryCount: 10,
          maxRetryDelay: TimeSpan.FromSeconds(30),
          errorNumbersToAdd: null);
      });
  });
  </code></pre>
  
  <p>I found this code snippet  at:</p>
  
  <p><a href="https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections" rel="noreferrer">https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections</a></p>
  
  <p>My DB is MySQL 5.7</p>
  
  <p>I changed the above code to :</p>
  
  <p><a href="https://i.stack.imgur.com/ETN89.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ETN89.png" alt="enter image description here"></a></p>
  
  <p>That means EnableRetryOnFailure is not available for MySQL DB. How do i set the retry, delay etc.. policies now?</p>
  
  <p>Also if i try to set the ExecutionStrategy function i get this:</p>
  
  <p><a href="https://i.stack.imgur.com/4i5b0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4i5b0.png" alt="enter image description here"></a> </p>
  
  <p>Then i tried Create my own Strategy using:</p>
  
  <pre><code>public class MyStrategy: ExecutionStrategy
  {
     ......
  }
  </code></pre>
  
  <p>but how to use this class now?</p>