Exemplo n.º 1
0
 /// <summary>
 /// ParseDbcFileHandler Constructor
 /// </summary>
 public ParseDbcFileHandler(
     ICanDatabaseContext databaseContext,
     IParseDbcFileService parseDbcFileService
     )
 {
     _databaseContext     = databaseContext;
     _parseDbcFileService = parseDbcFileService;
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="app"></param>
        /// <param name="databaseContext"></param>
        public void Configure(
            IApplicationBuilder app,
            ICanDatabaseContext databaseContext
            )
        {
            if (_webApiConfiguration.AppConfiguration.AppEnvironment == Common.Enums.AppEnvironment.Development)
            {
                app.UseWebAssemblyDebugging();
            }

            if (databaseContext.Database.IsRelational())
            {
                databaseContext.Database.Migrate();
            }

            app.UseSecurityHeadersMiddleware(securityHeadersBuilder =>
            {
                securityHeadersBuilder.AddDefaultSecurePolicy();
            });

            app.UseHsts();

            app.UseSwagger();
            app.UseSwaggerUI(options =>
            {
                foreach (var apiVersion in _webApiConfiguration.AppConfiguration.ApiVersions)
                {
                    options.SwaggerEndpoint(
                        url: $"/{SwaggerDocumentDefinitionRoutePrefix}/{apiVersion}/{SwaggerDefinitionFileName}",
                        name: $"{ApiDescriptionNamePrefix} {apiVersion}"
                        );
                }
                options.RoutePrefix = SwaggerApiExplorerRoute;
            });

            app.UseExceptionHandler("/Error");
            app.UseHttpsRedirection();
            app.UseBlazorFrameworkFiles();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHealthChecks("/health");
                endpoints.MapRazorPages();
                endpoints.MapControllers();
                endpoints.MapFallbackToFile("index.html");
            });
        }
Exemplo n.º 3
0
 /// <summary>
 /// GetCanDbsHandler Constructor
 /// </summary>
 public GetCanDbsHandler(
     ICanDatabaseContext databaseContext
     )
 {
     _databaseContext = databaseContext;
 }
Exemplo n.º 4
0
 /// <summary>
 /// DeleteCanDbHandler Constructor
 /// </summary>
 public DeleteCanDbHandler(
     ICanDatabaseContext databaseContext
     )
 {
     _databaseContext = databaseContext;
 }