示例#1
0
        /// <summary>
        /// 创建THttpApi的代理实例
        /// </summary>
        /// <typeparam name="THttpApi"></typeparam>
        /// <param name="client">httpClient</param>
        /// <param name="services">服务提供者</param>
        /// <param name="options">配置选项</param>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="NotSupportedException"></exception>
        /// <exception cref="ProxyTypeCreateException"></exception>
        /// <returns></returns>
        public static THttpApi Create <THttpApi>(HttpClient client, IServiceProvider services, HttpApiOptions options)
        {
            var context = new ServiceContext(client, services, options);

            return(Create <THttpApi>(new ActionInterceptor(context)));
        }
示例#2
0
 /// <summary>
 /// Api请求的任务
 /// </summary>       
 /// <param name="invoker"></param>
 /// <param name="context"></param>
 /// <param name="arguments"></param>
 public ActionTask(ActionInvoker<TResult> invoker, ServiceContext context, object?[] arguments)
 {
     this.invoker = invoker;
     this.context = context;
     this.arguments = arguments;
 }