Created
January 5, 2015 04:10
-
-
Save Luis-Palacios/65ed8315d60545439c2e to your computer and use it in GitHub Desktop.
Chossing connection string according to Environment Variable
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
private static string GetConnectionString() | |
{ | |
var environmentVariable = Environment.GetEnvironmentVariable("FunctionalTests"); | |
return environmentVariable == null | |
? ConfigurationManager.ConnectionStrings["SchoolContext"].ConnectionString | |
: ConfigurationManager.ConnectionStrings["SchoolContext-FunctionalTests"].ConnectionString; | |
} | |
//Si esta setiado el valor de la variable de entorno FunctionalTests usa la base de datos para la prueba |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment