public IServiceProvider ConfigureServices(IServiceCollection services) { services.ConfigureMvc() .ConfigureCors(Configuration) .AddSignalR(); _applicationContainer = new IocContainerBootstrapper().BuildContainer(services); return(new AutofacServiceProvider(_applicationContainer)); }
public IServiceProvider ConfigureServices(IServiceCollection services) { // Add framework services. services.AddMvc().AddJsonOptions( options => options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver()); services.AddCors( options => options.AddPolicy( CorsPolicyName, builder => builder.AllowAnyMethod().AllowAnyHeader().WithOrigins($"http://localhost:{SignalRPort}"))); services.AddSignalR(); services.ConfigureWritable <ApplicationSettings>( Configuration.GetSection(nameof(FolderSettings)), $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/EveHQ NG/Settings/ApplicationSettings.json"); _applicationContainer = new IocContainerBootstrapper().BuildContainer(services); return(new AutofacServiceProvider(_applicationContainer)); }