Skip to content

Commit

Permalink
only do db check on the first run of dotnet watch
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed May 24, 2024
1 parent 8cf2293 commit bc94006
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CleanAspCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@

if (app.Environment.IsDevelopment())
{
app.EnsureHrContextDatabaseIsCreated();
var watchIteration = app.Configuration.GetValue("DOTNET_WATCH_ITERATION", 1);
if (watchIteration == 1)
{
app.EnsureHrContextDatabaseIsCreated();
}

app.UseSwagger();
app.UseSwaggerUI();
}
Expand Down

0 comments on commit bc94006

Please sign in to comment.