// 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); }
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); }
// 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); }
// 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); }
public void ConfigureServices(IServiceCollection services) { InjectionConfiguration.Configure(services); services.AddMvc(); SwaggerConfiguration.ConfigureServices(services); }