Пример #1
0
 public static RPCHttpResult <TResult> Map <TSource, TResult>(this IRPCService @this, Func <TSource, TResult> selector, string serviceName,
                                                              string relativePath,
                                                              object data = default,
                                                              IDictionary <string, string> headers = default,
                                                              HttpMethod httpMethod = default)
     where TSource : class, new()
 {
     if (selector == default)
     {
         throw new ArgumentNullException(nameof(selector));
     }
     return(Map <TSource, TResult>(@this, (source, statusCode) => selector(source), serviceName, relativePath, data, headers, httpMethod));
 }
Пример #2
0
        public static RPCHttpResult <TResult> Map <TSource, TResult>(this IRPCService @this, Func <TSource, HttpStatusCode, TResult> selector, string serviceName,
                                                                     string relativePath,
                                                                     object data = default,
                                                                     IDictionary <string, string> headers = default,
                                                                     HttpMethod httpMethod = default)
            where TSource : class, new()
        {
            if (selector == default)
            {
                throw new ArgumentNullException(nameof(selector));
            }

            var httpResult       = @this.CallHttpServiceAsync <TSource>(serviceName, relativePath, httpMethod, data, default, headers).GetAwaiter().GetResult();
Пример #3
0
 public virtual bool  AddRPCService(IRPCService RPCService)
 {
     return(false);
 }