Skip to content

Instantly share code, notes, and snippets.

@ankitvijay

ankitvijay/Startup.cs

Last active Dec 22, 2019
Embed
What would you like to do?
Startup.cs
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