Entity Framework Core Interview Question #188

What is an EF Core execution strategy?

Testing, Production Practices & Senior Real-World Scenarios Senior Advanced

Quick Interview Answer

An execution strategy controls how database operations are executed and can retry transient failures for providers that support retry policies. For example, SQL Server configuration can enable retry-on-failure behavior. Retries improve resilience but can increase latency during outages and require careful handling of transactions and side effects.

Detailed Explanation

An execution strategy controls how database operations are executed and can retry transient failures for providers that support retry policies. For example, SQL Server configuration can enable retry-on-failure behavior. Retries improve resilience but can increase latency during outages and require careful handling of transactions and side effects.

Code Example

options.UseSqlServer(connectionString, sql =>
    sql.EnableRetryOnFailure());