|
Clean Architecture Demo
|
Go to the source code of this file.
Classes | |
| class | Program |
| Partial Program class made public for testing purposes. Allows WebApplicationFactory to access the Program configuration in integration tests. More... | |
Typedefs | |
| using | scope |
Functions | |
| builder.Configuration. | AddUserSecrets (Assembly.GetExecutingAssembly(), optional:true) |
| builder.Configuration. | AddInMemoryCollection (new Dictionary< string, string?> {["ConnectionStrings:DefaultConnection"]=connectionString }) |
| builder.Services. | AddSingleton< SqliteConnection > (_=> { var connection=new SqliteConnection(connectionString);connection.Open();return connection;}) |
| builder.Services. | AddAuthentication (JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options |
| builder.Services. | AddAuthorization () |
| builder.Services. | AddDbContext< TaskDbContext > (options=> options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"))) .AddScoped< IUnitOfWork >(sp |
| app. | UseHttpsRedirection () |
| app. | UseAuthentication () |
| app. | UseAuthorization () |
| app. | MapControllers () |
| app. | Run () |
Variables | |
| var | builder = WebApplication.CreateBuilder(args) |
| const string | connectionString = "Data Source=file:taskmanagement?mode=memory&cache=shared" |
| var | bearerSection = builder.Configuration.GetSection("Authentication:Schemes:Bearer") |
| var | validIssuer = bearerSection["ValidIssuer"] |
| var | validAudiences |
| var | signingKeys |
| var | app = builder.Build() |
| using scope |
Definition at line 137 of file Program.cs.
| builder.Services. AddAuthentication | ( | JwtBearerDefaults.AuthenticationScheme | ) |
Definition at line 92 of file Program.cs.
| builder.Services. AddAuthorization | ( | ) |
| builder.Services. AddDbContext< TaskDbContext > | ( | options | , |
| options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")) | ) |
Definition at line 109 of file Program.cs.
| builder.Configuration. AddInMemoryCollection | ( | new Dictionary< string, string?> {["ConnectionStrings:DefaultConnection"]=connectionString } | ) |
| builder.Services. AddSingleton< SqliteConnection > | ( | _ | , |
| { var connection=new SqliteConnection(connectionString);connection.Open();return connection;} | ) |
| builder.Configuration. AddUserSecrets | ( | Assembly. | GetExecutingAssembly(), |
| optional:true | ) |
| app. MapControllers | ( | ) |
| app. Run | ( | ) |
| app. UseAuthentication | ( | ) |
| app. UseAuthorization | ( | ) |
| app. UseHttpsRedirection | ( | ) |
| var app = builder.Build() |
Definition at line 135 of file Program.cs.
| var bearerSection = builder.Configuration.GetSection("Authentication:Schemes:Bearer") |
Definition at line 77 of file Program.cs.
| var builder = WebApplication.CreateBuilder(args) |
Definition at line 60 of file Program.cs.
|
static |
Definition at line 66 of file Program.cs.
| var signingKeys |
Definition at line 82 of file Program.cs.
| var validAudiences |
Definition at line 79 of file Program.cs.
| var validIssuer = bearerSection["ValidIssuer"] |
Definition at line 78 of file Program.cs.