Example #1
0
        /// <summary>
        /// 创建服务
        /// </summary>
        /// <typeparam name="T">泛型</typeparam>
        /// <typeparam name="F">泛型</typeparam>
        /// <returns>
        /// 类型
        /// </returns>
        /// 时间:2016/9/6 16:54
        /// 备注:
        public override T CreateService <T, F>()
        {
            var uri   = string.Empty;
            var proxy = WcfServiceProxy.CreateServiceProxy <T>(uri);

            return(proxy);
        }
Example #2
0
        public override T CreateService <T>()
        {
            //需实现WCF Uri来自配置文件
            var uri   = string.Empty;
            var proxy = WcfServiceProxy.CreateServiceProxy <T>(uri);

            return(proxy);
        }
Example #3
0
 public override T CreateService <T>()
 {
     if (CachedFileConfigContext.Current.WcfServiceConfig != null)
     {
         var wcfService = CachedFileConfigContext.Current.WcfServiceConfig;
         var wcf        = wcfService.WcfServiceItems.Where(item => item.ContractType == typeof(T).FullName).FirstOrDefault();
         if (wcf != null)
         {
             return(WcfServiceProxy.CreateServiceProxy <T>(wcf.Uri, EnumHelper.Parse <WcfServiceProxy.WcfServiceBinding>(wcf.Binding)));
         }
     }
     return(default(T));
 }
Example #4
0
 public override T CreateService <T>()
 {
     return(WcfServiceProxy.CreateServiceProxy <T>(string.Empty));
 }