/// <summary> /// Register the given RestEase interface type to use the a <see cref="HttpClient"/> /// from the given <see cref="IHttpClientBuilder"/> /// </summary> /// <param name="httpClientBuilder"><see cref="IHttpClientBuilder"/> which RestEase should use a <see cref="HttpClient"/> from</param> /// <param name="restEaseType">Type of the RestEase interface</param> /// <param name="configurer">Optional delegate to configure the <see cref="RestClient"/> (to set serializers, etc)</param> /// <returns>The <see cref="IHttpClientBuilder"/> for further configuration</returns> public static IHttpClientBuilder UseWithRestEaseClient( this IHttpClientBuilder httpClientBuilder, Type restEaseType, Action <RestClient>?configurer = null) { return(httpClientBuilder.AddRestEaseClientCore(restEaseType, NonGenericFactory(restEaseType, configurer))); }
/// <summary> /// Register the given RestEase interface type to use the a <see cref="HttpClient"/> /// from the given <see cref="IHttpClientBuilder"/> /// </summary> /// <typeparam name="T">Type of the RestEase interface</typeparam> /// <param name="httpClientBuilder"><see cref="IHttpClientBuilder"/> which RestEase should use a <see cref="HttpClient"/> from</param> /// <param name="configurer">Optional delegate to configure the <see cref="RestClient"/> (to set serializers, etc)</param> /// <returns>The <see cref="IHttpClientBuilder"/> for further configuration</returns> public static IHttpClientBuilder UseWithRestEaseClient <T>( this IHttpClientBuilder httpClientBuilder, Action <RestClient>?configurer = null) where T : class { return(httpClientBuilder.AddRestEaseClientCore(typeof(T), GenericFactory <T>(configurer))); }