Created
December 25, 2018 13:41
-
-
Save explorer14/2e4492d6b934af28bb290d504d70f044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddDbContext<PeriodContext>(options => | |
options.UseSqlServer( | |
Configuration.GetConnectionString("DbConnectionString"), | |
builderOptions => | |
builderOptions.EnableRetryOnFailure(3)), | |
ServiceLifetime.Scoped); | |
services.AddHealthChecks() | |
.AddCheck("SQL Server", | |
new DatabaseHealthCheck( | |
services.BuildServiceProvider() | |
.GetService<PeriodContext>())); | |
// rest of the services | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment