Go to the source code of this file.
|
| class | Program |
| | Partial Program class made public for testing purposes. Allows WebApplicationFactory to access the Program configuration in integration tests. More...
|
| |
|
| using | scope = app.Services.CreateScope()) { var dbContext=scope.ServiceProvider.GetRequiredService< TaskDbContext >() |
| |
◆ scope
| using scope = app.Services.CreateScope()) { var dbContext = scope.ServiceProvider.GetRequiredService<TaskDbContext>() |
◆ AddAuthentication()
| builder.Services. AddAuthentication |
( |
JwtBearerDefaults. |
AuthenticationScheme | ) |
|
◆ AddAuthorization()
| builder.Services. AddAuthorization |
( |
| ) |
|
◆ AddInMemoryCollection()
| builder.Configuration. AddInMemoryCollection |
( |
new Dictionary< string, string?> {["ConnectionStrings:DefaultConnection"]=connectionString } |
| ) |
|
◆ AddMediatR()
◆ AddSingleton< SqliteConnection >()
| builder.Services. AddSingleton< SqliteConnection > |
( |
_ |
, |
|
|
{ var connection=new SqliteConnection(connectionString);connection.Open();return connection;} |
|
|
) |
| |
◆ AddUserSecrets()
| builder.Configuration. AddUserSecrets |
( |
Assembly. |
GetExecutingAssembly(), |
|
|
optional:true |
|
|
) |
| |
◆ EnsureCreated()
| dbContext.Database. EnsureCreated |
( |
| ) |
|
◆ MapControllers()
◆ Run()
◆ typeof()
◆ UseAuthentication()
| app. UseAuthentication |
( |
| ) |
|
◆ UseAuthorization()
| app. UseAuthorization |
( |
| ) |
|
◆ UseHttpsRedirection()
| app. UseHttpsRedirection |
( |
| ) |
|
◆ UseMiddleware< ExceptionHandlingMiddleware >()
◆ app
| var app = builder.Build() |
◆ bearerSection
| var bearerSection = builder.Configuration.GetSection("Authentication:Schemes:Bearer") |
◆ builder
| var builder = WebApplication.CreateBuilder(args) |
◆ connectionString
| const string connectionString = "Data Source=file:taskmanagement?mode=memory&cache=shared" |
|
static |
◆ signingKeys
Initial value:
.GetSection("SigningKeys")
.GetChildren()
.Select(x => x["Value"])
.Where(x => !string.IsNullOrWhiteSpace(x))
.Select(x => new SymmetricSecurityKey(Convert.FromBase64String(x!)))
.Cast<SecurityKey>()
.ToArray()
Definition at line 77 of file Program.cs.
◆ validAudiences
Initial value:
.GetSection("ValidAudiences")
.Get<string[]>() ?? []
Definition at line 74 of file Program.cs.
◆ validIssuer