EF Core and SqlAzureExecutionStrategy

azure-sql-database entity-framework-core

Question

I've tried to have a search for anything related to a SqlAzureExecutionStrategy for EF core and came up empty handed.

Does anyone have any information around the need for setting an execution strategy when using EF Core and SQL Azure?

1
15
12/6/2016 12:13:04 AM

Accepted Answer

In EF Core it's called SqlServerRetryingExecutionStrategy as it is also useful for on-premise SQL Server if you are using memory-optimized tables for example.

It can be enabled in this way:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    optionsBuilder
        .UseSqlServer(
            "<connection string>",
            options => options.EnableRetryOnFailure());
}

See Connection Resiliency for more info.

26
12/6/2016 12:30:15 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow