public override void Register(IRegisteContext context) { base.Register(context); var services = context.Services; services.AddScoped <ComicRankService>(); services.AddScoped <BookshelfService>(); services.AddScoped <SearchStatisticalService>(); services.AddScoped <VisitStatisticalService>(); services.AddScoped <WorkReadStatisticalService>(); services.AddScoped <WordUpdateStatisticalService>(); services.AddScoped <WordUserStatisticalService>(); services.AddOptions <BookshelfOptions>(); services.AddOptions <ComicRankOptions>(); services.AddScoped <ReadingManager>(); services.AddScoped <AppService>(); services.AddScoped <VisitRankFinder>(); services.AddScoped <VisitRankFinder50FlushJob>(); services.AddOptions <VisitRankFetcherOptions>("VisitRank"); services.AddSingleton <ComicImageFinder>(); }
public override void Register(IRegisteContext context) { base.Register(context); var services = context.Services; services.AddScoped <IDataAccesstor <ulong, WordResponse>, WordDataAccessor>(); services.AddSingleton <RandomWordResultCacheFinder>(); }
public void RegisteServices(IServiceCollection services, IRegisteContext context) { services.AddSingleton <CosXmlServer>(); services.AddSingleton <CosXmlConfig>(sp => { return(new CosXmlConfig.Builder() .SetAppid("1259347065") .SetRegion("ap-nanjing") .SetDebugLog(true) .Build()); }); services.AddSingleton <QCloudCredentialProvider>(sp => { var hostEnvironment = sp.GetRequiredService <Microsoft.Extensions.Hosting.IHostEnvironment>(); string envName = hostEnvironment.EnvironmentName; bool isDevelopment = hostEnvironment.IsDevelopment(); var qCloud = sp.GetRequiredService <QCloudOptions>(); return(new DefaultQCloudCredentialProvider(qCloud.SecretId, qCloud.SecretKey, qCloud.KeyDurationSecond)); }); }
public override void Register(IRegisteContext context) { base.Register(context); var services = context.Services; var config = context.Features.GetConfiguration(); services.AddSingleton(Program.modules); //var store = FileStoreService.FromMd5Default(Path.Combine(Environment.CurrentDirectory, XComicConst.CacheFolderName)); AddComicAnalysis(services) .AddAzureStore(services, config) .AddSpa(services) .AddSignalR(services, config) .AddEF(services, config) .AddCache(services, config) .AddFetch(services, config) .AddSwagger(services) .AddQuartz(services) .AddAuth(services); #if !DEBUG services.AddApplicationInsightsTelemetry(config["APPINSIGHTSCONNECTIONSTRING"]); #endif services.AddControllersWithViews(); services.AddResponseCaching(); services.AddResponseCompression(); services.AddNormalSecurityService(); services.AddOptions <ResourceLockOptions>(); KnowsCacheValueConverter.EndValueConverter = new JsonCacheValueConverter(); }
public void RegisterServices(IServiceCollection services, IRegisteContext context) { services.TryAddSingleton <IHttpContextAccessor, HttpContextAccessor>(); }
public void RegisteServices(IServiceCollection services, IRegisteContext context) { services.AddMemoryCache(); }
public void RegisteServices(IServiceCollection services, IRegisteContext context) { }
public void RegisteServices(IServiceCollection services, IRegisteContext context) { services.AddKeyValue(); }
public override void RegisterService(IServiceCollection services, IRegisteContext context, Type declareType) { services.AddTransient(typeof(IAppContextValue), declareType); }
public void RegisteServices(IServiceCollection services, IRegisteContext context) { services.AddHttpClient(); }