Add retry option for SQL server example.

This commit is contained in:
Kevin Matsubara 2025-04-14 22:33:02 +02:00
parent b32e390c5c
commit 2d14366feb

View File

@ -42,6 +42,13 @@ public class DeadBallZoneLeagueDbContext : DbContext
.HasName("GetEarliestMatch");
}
// This is an example override for SQL Server:
// protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=FootballLeague_EfCore; Encrypt=true", sqlOptions => {
// sqlOptions.EnableRetryOnFailure(maxRetryCount: 5,
// maxRetryDelay: TimeSpan.FromSeconds(5),
// errorNumbersToAdd: null);
// });
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
// These apply to all the settings for all models.