Exemple #1
0
 /// <summary>
 /// Sends the specified rpc request to the server
 /// </summary>
 /// <param name="request">Single rpc request that will goto the rpc server</param>
 /// <param name="route">(Optional) Route that will append to the base url if the request method call is not located at the base route</param>
 /// <typeparam name="T">The deserialization type for the response result.</typeparam>
 /// <returns>The rpc response for the sent request</returns>
 public async Task <RpcResponse <T> > SendRequestAsync <T>(RpcRequest request, string route = null)
 {
     if (request == null)
     {
         throw new ArgumentNullException(nameof(request));
     }
     return(RpcResponse <T> .FromResponse(await this.SendRequestAsync(request, route, typeof(T)).ConfigureAwait(false)));
 }
Exemple #2
0
 /// <summary>
 /// Sends the specified rpc request to the server (Wrapper for other SendRequestAsync)
 /// </summary>
 /// <param name="method">Rpc method that is to be called</param>
 /// <param name="route">(Optional) Route that will append to the base url if the request method call is not located at the base route</param>
 /// <param name="paramMap">Map of parameters for the rpc method</param>
 /// <typeparam name="T">The deserialization type for the response result.</typeparam>
 /// <returns>The rpc response for the sent request</returns>
 public async Task <RpcResponse <T> > SendRequestWithMapAsync <T>(string method, string route, IDictionary <string, object> paramMap)
 {
     return(RpcResponse <T> .FromResponse(await this.SendRequestWithMapAsync(method, route, paramMap, typeof(T))));
 }
Exemple #3
0
 public List <RpcResponse <T> > GetResponses <T>()
 {
     return(this.responses
            .Select(r => RpcResponse <T> .FromResponse(r.Value))
            .ToList());
 }
Exemple #4
0
 /// <summary>
 /// Sends the specified rpc request to the server (Wrapper for other SendRequestAsync)
 /// </summary>
 /// <param name="method">Rpc method that is to be called</param>
 /// <param name="route">(Optional) Route that will append to the base url if the request method call is not located at the base route</param>
 /// <param name="paramList">List of parameters (in order) for the rpc method</param>
 /// <typeparam name="T">The deserialization type for the response result.</typeparam>
 /// <returns>The rpc response for the sent request</returns>
 public async Task <RpcResponse <T> > SendRequestWithListAsync <T>(string method, string route, IList <object> paramList)
 {
     return(RpcResponse <T> .FromResponse(await this.SendRequestWithListAsync(method, route, paramList, typeof(T))));
 }
Exemple #5
0
 public RpcResponse <T> GetResponse <T>(RpcId id)
 {
     return(RpcResponse <T> .FromResponse(this.responses[id]));
 }