Skip to content

Commit

Permalink
using environment
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindarbydev committed Aug 18, 2023
1 parent dd83826 commit 32844fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
var builder = WebApplication.CreateBuilder(args);

builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
var connectionString = builder.Configuration.GetConnectionString("AppDbContext") ?? throw new InvalidOperationException("Connection string 'AppDbContext' not found.");

//var connectionString = builder.Configuration.GetConnectionString("AppDbContext") ?? throw new InvalidOperationException("Connection string 'AppDbContext' not found.");
var connectionString = Environment.GetEnvironmentVariable("AppDbContext");
builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlServer(connectionString));

builder.Services.AddIdentity<ApplicationUser, IdentityRole>(options => options.SignIn.RequireConfirmedAccount = false)
Expand Down

0 comments on commit 32844fe

Please sign in to comment.