Last active
December 22, 2019 21:16
-
-
Save ankitvijay/51c24a04d6e71c6c0ac3313663098f7a to your computer and use it in GitHub Desktop.
Startup.cs
This file contains 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 class Startup | |
{ | |
private readonly IConfiguration _configuration; | |
public Startup(IConfiguration configuration) | |
{ | |
_configuration = configuration; | |
} | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
var deployment = _configuration["Deployment"]; | |
var connectionString = _configuration["ConnectionString"]; | |
// Code removed for brevity | |
if (deployment == "Azure") | |
{ | |
// Inject SQL Server dependency | |
} | |
else | |
{ | |
// Inject MySQL dependency | |
} | |
} | |
// Code removed for brevity | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment