public void CopyFrom(HttpClientSettings settings)
 {
     ServiceProtocol = settings.ServiceProtocol;
     Port            = settings.Port;
     Context         = settings.Context;
     Hostname        = settings.Hostname;
 }
Beispiel #2
0
 public static void ConfigureHttpClientService(this IServiceCollection services, HttpClientSettings settings)
 {
     services.AddHttpClient <HttpGenericBaseClient>();
     services.Configure <HttpClientSettings>(o => o.CopyFrom(settings));
     services.TryAddTransient <IHttpGenericBaseClient, HttpGenericBaseClient>();
 }