Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. services.AddScoped<YourDbContext>(svc =>
  2. {
  3. var connString = ... logic to get the conn string with the right password from HashiCorp vault;
  4. var dbContextOptions = new DbContextOptionsBuilder<YourDbContext>();
  5. dbContextOptions.UseSqlServer(connString); //Or w/e ef provider for db you use
  6. return new YourDbContext(dbContextOptions.Options);
  7. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement