예제 #1
0
 /// <summary>
 /// 创建实现了指定接口的HttpApiClient实例
 /// </summary>
 /// <typeparam name="TInterface">请求接口类型</typeparam>
 /// <param name="httpApiConfig">接口配置</param>
 /// <exception cref="ArgumentNullException"></exception>
 /// <exception cref="ArgumentException"></exception>
 /// <exception cref="NotSupportedException"></exception>
 /// <exception cref="TypeLoadException"></exception>
 /// <returns></returns>
 public static TInterface Create <TInterface>(HttpApiConfig httpApiConfig) where TInterface : class, IHttpApi
 {
     return(Create(typeof(TInterface), httpApiConfig) as TInterface);
 }
예제 #2
0
        /// <summary>
        /// 创建实现了指定接口的HttpApiClient实例
        /// </summary>
        /// <typeparam name="TInterface">请求接口类型</typeparam>
        /// <exception cref="ArgumentException"></exception>
        /// <exception cref="NotSupportedException"></exception>
        /// <exception cref="TypeLoadException"></exception>
        /// <returns></returns>
        public static TInterface Create <TInterface>() where TInterface : class, IHttpApi
        {
            var config = new HttpApiConfig();

            return(Create <TInterface>(config));
        }