Skip to content

Commit

Permalink
Update skip check
Browse files Browse the repository at this point in the history
  • Loading branch information
captainsafia committed Aug 21, 2024
1 parent 8d7b046 commit c86bab7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions aspnetcore/fundamentals/openapi/samples/9.x/BuildTime/Skip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

if (Assembly.GetEntryAssembly()?.GetName().Name != "MyTestApi")
{
builder.Services.AddDbContext<ControllerApiContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("ControllerApiContext")
?? throw new InvalidOperationException("Connection string 'ControllerApiContext' not found.")));
var schemeName = builder.Configuration.GetValue<string>("Authentication:SchemeName");
builder.Services.AddAuthentication(schemeName);
}

builder.Services.AddControllers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"Authentication": {
"SchemeName": "Bearer"
}
}

0 comments on commit c86bab7

Please sign in to comment.