Skip to content

Commit 121a92c

Browse files
Fix for regression bug at AddDbContext<IntegrationEventLogContext> for Catalog.API
1 parent 373bdd9 commit 121a92c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Services/Catalog/Catalog.API/Startup.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
7979
//Check Client vs. Server evaluation: https://docs.microsoft.com/en-us/ef/core/querying/client-eval
8080
});
8181

82+
services.AddDbContext<IntegrationEventLogContext>(options =>
83+
{
84+
options.UseSqlServer(Configuration["ConnectionString"],
85+
sqlServerOptionsAction: sqlOptions =>
86+
{
87+
sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
88+
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
89+
sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
90+
});
91+
});
92+
8293
services.Configure<CatalogSettings>(Configuration);
8394

8495
// Add framework services.

0 commit comments

Comments
 (0)