Last active
August 8, 2021 08:38
-
-
Save executeautomation/804db9f685c43e48565e933e1e996a60 to your computer and use it in GitHub Desktop.
DbContext
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
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
var configuration = new ConfigurationBuilder() | |
.SetBasePath(Directory.GetCurrentDirectory()) | |
.AddJsonFile("appsettings.json") | |
.Build(); | |
var connectionString = configuration.GetConnectionString("AppDb"); | |
optionsBuilder.UseSqlServer(connectionString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment