Ejemplo n.º 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));
 }
Ejemplo n.º 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();
Ejemplo n.º 3
0
 public virtual bool  AddRPCService(IRPCService RPCService)
 {
     return(false);
 }