Пример #1
0
 /// <summary>
 /// Add the Slack client to the service collection as a singleton.
 /// </summary>
 /// <param name="services">The service collection.</param>
 /// <param name="config">The slack configuration.</param>
 /// <returns>The passed service collection.</returns>
 public static IHttpClientBuilder AddSlack(this IServiceCollection services, SlackConfig config)
 {
     services.AddSingleton(config);
     return(services.AddHttpClient <ISlackClient, SlackClient>());
 }
Пример #2
0
 public SlackClient(SlackConfig config, HttpClient httpClient)
 {
     _config     = config ?? throw new ArgumentNullException(nameof(config));
     _httpClient = httpClient;
 }