コード例 #1
0
        public BaiduYunSmsClient(BaiduYunConfig config, Action <Exception> exceptionHandler = null)
        {
            _config       = config ?? throw new ArgumentNullException(nameof(config));
            _account      = _config.Account ?? throw new ArgumentNullException(nameof(_config.Account));
            _apiServerUrl = $"{GetHttpPrefix(config)}://{GetApiServerUrl(config)}";
            _proxy        = HttpApiClient.Create <IBaiduYunSmsApis>(_apiServerUrl);

            var globalHandle = ExceptionHandleResolver.ResolveHandler();

            globalHandle     += exceptionHandler;
            _exceptionHandler = globalHandle;
        }
コード例 #2
0
        public BaiduYunSmsClient(BaiduYunConfig config, Action <Exception> exceptionHandler = null)
        {
            _config       = config ?? throw new ArgumentNullException(nameof(config));
            _account      = _config.Account ?? throw new ArgumentNullException(nameof(_config.Account));
            _apiServerUrl = ApiAddressHelper.Get(config);
            _proxy        = WebApiClientCreator.Create(_apiServerUrl, _config.TimeOut);

            var globalHandle = ExceptionHandleResolver.ResolveHandler();

            globalHandle     += exceptionHandler;
            _exceptionHandler = globalHandle;
        }