Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
            services.AddDbContext <PHContext>(options => options.UseSqlServer(Configuration.GetConnectionString("PHConnectionString")));

            SwaggerConfiguration.ConfigureServices(services);
            DependencyInjection.Configure(services);
        }
Ejemplo n.º 2
0
 public void ConfigureServices(IServiceCollection services)
 {
     SimpleInjectorConfiguration.ConfigureServices(services, _configuration);
     CorsConfiguration.ConfigureServices(services);
     MvcConfiguration.ConfigureServices(services);
     SwaggerConfiguration.ConfigureServices(services);
     HangfireConfiguration.ConfigureServices(services, _configuration);
     DatabaseConfiguration.ConfigureServices(services, _configuration);
 }
Ejemplo n.º 3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
                options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
            });

            services.AddMemoryCache();

            SwaggerConfiguration.ConfigureServices(services);
            RepositoriosProvider.Configurar(services, Configuration);
            ServicosProvider.Configurar(services);
            InfraestruturaProvider.Configurar(services, Configuration);
            ConfigureAuthServices(services);
        }
Ejemplo n.º 4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var businessAssembly  = typeof(HashDecoderAPI.Business.MappingProfile).Assembly;
            var contractsAssembly = typeof(HashDecoderAPI.Contracts.Marker).Assembly;

            // services.AddDbContext<HashDecoderAPIContext>(options => options.UseSqlServer(Configuration["ConnectionStrings:Default"]));
            services.AddAutoMapper(businessAssembly, contractsAssembly);
            services.AddMediatR(businessAssembly, contractsAssembly);
            services
            .AddMvc()
            .AddControllersAsServices()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            SwaggerConfiguration.ConfigureServices(services, Configuration);

            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            IocConfiguration.RegisterAllDependencies(services);
            AuthConfiguration.ConfigureServices(services, Environment, Configuration);
        }
Ejemplo n.º 5
0
 public void ConfigureServices(IServiceCollection services)
 {
     InjectionConfiguration.Configure(services);
     services.AddMvc();
     SwaggerConfiguration.ConfigureServices(services);
 }