public LogReaderHelper(IDatabase database, IHttpContextReader httpContextReader, LogActionPermissionDictionary logActionPermissionDictionary, IConfiguration configuration) { this.database = database; this.httpContextReader = httpContextReader; this.logActionPermissionDictionary = logActionPermissionDictionary; Configuration = configuration; }
public void ConfigureServices(IServiceCollection services) { services.AddControllers(); DapperAppConfig.ConfigureSqlMapper(); services.ConfigureAuthentication(Configuration); services.ConfigureAuthorization(); services.ConfigureMvc() .ConfigureFluentValidation(); services.ConfigureIpRateLimit(Configuration); services.ConfigureDatabase(Configuration); services.Configure <ApiBehaviorOptions>(options => { options.SuppressModelStateInvalidFilter = true; }); services.AddOptions(); services.AddHttpContextAccessor(); services.AddHttpClient(); services.ConfigureCors(); services.AddMediatR(Assembly.Load("MTA.Core.Application")); #region services services.ConfigureScopedServices(); services.ConfigureSingletonServices(); #endregion services.ConfigureCaching(); services.ConfigureSettings(Configuration); services.AddAutoMapper(typeof(MapperProfile)); services.AddDirectoryBrowser(); services.ConfigureServerHostedServices(); services.ConfigureSwagger(); services.AddSignalR(); services.AddSingleton <HubNamesDictionary>(s => HubNamesDictionary.Build()); services.AddSingleton <LogActionPermissionDictionary>(s => LogActionPermissionDictionary.Build()); services.AddSingleton <LogKeyWordsDictionary>(s => LogKeyWordsDictionary.Build()); services.Configure <ForwardedHeadersOptions>(options => { options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; }); }