Last active
January 5, 2020 13:31
-
-
Save HoussemDellai/06f4774cbb33940be565ec21cc49bf98 to your computer and use it in GitHub Desktop.
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
var host = Configuration.GetValue<string>("host"); | |
var database = Configuration.GetValue<string>("database"); | |
var port = Configuration.GetValue<string>("port"); | |
var username = Configuration.GetValue<string>("username"); | |
var password = Configuration.GetValue<string>("password"); | |
var connectionString = | |
$"Server={host},{port};Database={database};User={username};Password={password};"; | |
services.AddDbContext<ProductsContext>(options => | |
options.UseSqlServer(connectionString)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment