예제 #1
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to add services to the container.
        /// </summary>
        public void ConfigureServices(IServiceCollection services)
        {
            ApiVersioningConfiguration.ConfigureService(services);

            services.AddMvc();

            LoadAppSettings.IntoInjector(services, Configuration);

            DependencyInjectorHost.Configure(services);

            // Swagger
            SwaggerStartupConfiguration.ConfigureService(services, environment);
        }
예제 #2
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to add services to the container.
        /// </summary>
        public void ConfigureServices(IServiceCollection services)
        {
            //Ini Habilitar Cors
            services.AddCors();

            services.AddControllers();
            LoadAppSettings.IntoInjector(services, Configuration);
            DependencyInjectorHost.Configure(services);
            SwaggerStartupConfiguration.ConfigureService(services);
            AuthenticationConfiguration.AuthServices(services);
            CorsStartupConfiguration.ConfigureServices(services);

            //services.AddSingleton<ISingleton, Singleton>();
        }
예제 #3
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to add services to the container.
        /// </summary>
        public void ConfigureServices(IServiceCollection services)
        {
            //services.AddHttpClient();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            ApiVersioningConfiguration.ConfigureService(services);

            services.AddMvc();
            services.AddHttpClient();

            LoadAppSettings.IntoInjector(services, Configuration);

            DependencyInjectorHost.Configure(services);

            // Swagger
            SwaggerStartupConfiguration.ConfigureService(services, environment);
        }
예제 #4
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        /// </summary>
        /// <param name="application"></param>
        /// <param name="loggerFactory"></param>
        /// <param name="apiVersionDescriptionProvider"></param>
        public void Configure(IApplicationBuilder application,
                              ILoggerFactory loggerFactory,
                              IApiVersionDescriptionProvider apiVersionDescriptionProvider)
        {
            if (environment.IsEnvironment(EnvironmentTypes.Local))
            {
                application.UseDeveloperExceptionPage();

                application.UseStaticFiles();

                SwaggerStartupConfiguration.Configure(application, apiVersionDescriptionProvider);
            }

            CorrelationMiddleware.Configure(application);

            if (EnvironmentVariables.GetInMemoryDbValue())
            {
                var context = application.ApplicationServices.GetService <DataContext>();
                //MockDataInjector.Inject(context);
            }
            application.UseMvc();
        }
예제 #5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            //if (env.IsDevelopment())
            if (true)
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                SwaggerStartupConfiguration.Configure(app);
            }
            app.UseAuthentication();
            app.UseHttpsRedirection();
            app.UseRouting();

            //Habilitar Cors
            //app.UseCors();
            app.UseCors("FaceRecognition");

            app.UseAuthorization();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }