public CalendarController(IHttpContextAccessor contextAccessor, ITokenAcquisition tokenAcquisition, TimeHelperDataContext db, ILogger <CalendarController> logger, IConfiguration config) { _contextAccessor = contextAccessor; this.tokenAcquisition = tokenAcquisition; this.db = db; this.logger = logger; this.config = config; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, TimeHelperDataContext dataContext) { if (env.IsDevelopment()) { // Since IdentityModel version 5.2.1 (or since Microsoft.AspNetCore.Authentication.JwtBearer version 2.2.0), // PII hiding in log files is enabled by default for GDPR concerns. // For debugging/development purposes, one can enable additional detail in exceptions by setting IdentityModelEventSource.ShowPII to true. Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } dataContext.Database.Migrate(); app.UseHttpsRedirection(); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Time Helper API V1.0"); c.RoutePrefix = string.Empty; }); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public AssociationsController(TimeHelperDataContext context) { _context = context; }
public ProjectsController(TimeHelperDataContext context) { _context = context; }