public DownloadFactory(Func <DownloadServiceImplementation, IDownloadService> factory) { this.factory = factory; DownloadServiceImplementation downloadServiceImplementation = DownloadServiceImplementation.RestSharp; if (Enum.TryParse <DownloadServiceImplementation>(AppSettingsProvider.AppSettings.DownloadService, true, out var libraryFromSettings)) { downloadServiceImplementation = libraryFromSettings; } this.defaultDownloadService = downloadServiceImplementation; }
public IDownloadService GetDownloadService(DownloadServiceImplementation library) => factory(library);