TIL

Today I Learned


Project maintained by gushwell Hosted on GitHub Pages — Theme by mattgraham

以下のように EnableRetryOnFailure を記述することで、リトライが可能になる。

services.AddDbContext<CatalogContext>(options => {
    options.UseSqlServer(Configuration["ConnectionString"],
    sqlServerOptionsAction: sqlOptions => {
        sqlOptions.EnableRetryOnFailure(
            maxRetryCount: 10,
            maxRetryDelay: TimeSpan.FromSeconds(30),
            errorNumbersToAdd: null);
    });
});