/// <summary> /// 使用注入本地事件下载代理存储 /// </summary> /// <param name="builder"></param> /// <returns></returns> public static DownloadAgentRegisterCenterBuilder UseLocalDownloadAgentStore( this DownloadAgentRegisterCenterBuilder builder) { Check.NotNull(builder, nameof(builder)); builder.Services.AddSingleton <IDownloadAgentStore, LocalDownloadAgentStore>(); return(builder); }
public static IServiceCollection AddDownloadCenter(this IServiceCollection services, Action <DownloadAgentRegisterCenterBuilder> configure = null) { services.AddSingleton <IHostedService, DefaultDownloadAgentRegisterCenter>(); DownloadAgentRegisterCenterBuilder downloadCenterBuilder = new DownloadAgentRegisterCenterBuilder(services); configure?.Invoke(downloadCenterBuilder); return(services); }
public static DownloadAgentRegisterCenterBuilder UseMySql( this DownloadAgentRegisterCenterBuilder builder) { builder.Services.AddSingleton <IDownloaderAgentStore, MySqlDownloaderAgentStore>(); return(builder); }