示例#1
0
 public MailgunEmailSender(
     IMailgunOptionsProvider optionsProvider,
     IServiceClientProvider httpClientFactory,
     ILogger <MailgunEmailSender> logger
     )
 {
     _optionsProvider   = optionsProvider;
     _httpClientFactory = httpClientFactory;
     _log = logger;
 }
示例#2
0
 public ElasticEmailSender(
     IElasticEmailOptionsProvider optionsProvider,
     IServiceClientProvider httpClientFactory,
     ILogger <ElasticEmailSender> logger
     )
 {
     _optionsProvider   = optionsProvider;
     _httpClientFactory = httpClientFactory;
     _log = logger;
 }
示例#3
0
        /// <summary>
        /// Calls the specified client action by creating a client instance using the specified service client provider.
        /// </summary>
        public static void Call <TChannel>(this IServiceClientProvider <TChannel> provider, Action <TChannel> action)
            where TChannel : class
        {
            var channel = provider.CreateChannel();

            using (channel.AsDisposable())
            {
                action(channel);
            }
        }
示例#4
0
        /// <summary>
        /// Calls the specified client function by creating a client instance using the specified service client provider.
        /// </summary>
        public static TResult Call <TChannel, TResult>(this IServiceClientProvider <TChannel> provider, Func <TChannel, TResult> func)
            where TChannel : class
        {
            var channel = provider.CreateChannel();

            using (channel.AsDisposable())
            {
                var result = func(channel);
                return(result);
            }
        }
 public IotHubRequestBridgeNotifier(IServiceClientProvider serviceClientProvider)
 {
     _serviceClientProvider = serviceClientProvider ?? throw new ArgumentNullException(nameof(serviceClientProvider));
 }