Skip to content

How to extend optionsBuilder with more params such as EnableRetryOnFailure?Β #873

@nealculiner

Description

@nealculiner

Hello @sjh37 - just updated to 3.11.0. I'm using EF Core 10 and want to add to the GetConnectionString like below but I don't see how or where to add builder params to get this result. This is my desired end result where you can see I added builder => ... to the generated GetConnectionString

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    if (!optionsBuilder.IsConfigured && _configuration != null)
    {
        optionsBuilder.UseSqlServer(_configuration.GetConnectionString(@"foo"), builder => builder.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null));
    }
}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions