public ImageResizerClient( ImagesClientConfiguration <ImageResizerClient> configuration, ILogger <ImageResizerClient> logger, IHttpClientFactory?httpClientFactory = null) : base(configuration, logger, httpClientFactory) { }
public static IServiceCollection AddImageAnalyzerClient( this IServiceCollection services, IConfiguration configuration) { if (configuration is null) { throw new ArgumentNullException(nameof(configuration)); } var conf = new ImagesClientConfiguration(); configuration.Bind(conf); return(services.AddImageAnalyzerClient(conf)); }
public static IServiceCollection AddImageResizerClient( this IServiceCollection services, ImagesClientConfiguration configuration) { if (configuration is null) { throw new System.ArgumentNullException(nameof(configuration)); } if (string.IsNullOrEmpty(configuration.EndPoint)) { throw new InvalidOperationException("Image resizer client endpoint must not be empty"); } return(services .AddSingleton(configuration.AsTyped <ImageResizerClient>()) .AddSingleton <IImageResizer, ImageResizerClient>()); }