Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services.AddScoped<YourDbContext>(svc =>
- {
- var connString = ... logic to get the conn string with the right password from HashiCorp vault;
- var dbContextOptions = new DbContextOptionsBuilder<YourDbContext>();
- dbContextOptions.UseSqlServer(connString); //Or w/e ef provider for db you use
- return new YourDbContext(dbContextOptions.Options);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement