コード例 #1
0
        public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrEmpty(methodName))
            {
                throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(methodName));
            }

            if (string.IsNullOrEmpty(userId))
            {
                throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId));
            }

            var api = _restApiProvider.GetSendToUserEndpoint(_appName, _hubName, userId);

            return(_restClient.SendAsync(api, HttpMethod.Post, _productInfo, methodName, args, handleExpectedResponseAsync: null, cancellationToken: cancellationToken));
        }
コード例 #2
0
        public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrEmpty(methodName))
            {
                throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(methodName));
            }

            if (string.IsNullOrEmpty(userId))
            {
                throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId));
            }

            var api     = _restApiProvider.GetSendToUserEndpoint(userId);
            var request = BuildRequest(api, HttpMethod.Post, methodName, args);

            return(CallRestApiAsync(request, cancellationToken));
        }
コード例 #3
0
        public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default)
        {
            var api = _restApiProvider.GetSendToUserEndpoint(userId);

            return(CallRestApi(api, HttpMethod.Post, methodName, args, cancellationToken));
        }