コード例 #1
0
        public override K ResolveRequest(T request, string platform, ApiServiceName serviceName)
        {
            //TODO herencia
            //   BeginResolveRequest(request, ref platform, serviceName);

            IServiceProvider serviceImpl;

            if (platform.Equals("1"))
            {
                serviceImpl = ServiceProviderFactory.GetServiceProvider(ApiTargetPlatform.Kinacu, serviceName);
            }
            else if (platform.Equals("2"))
            {
                serviceImpl = ServiceProviderFactory.GetServiceProvider(ApiTargetPlatform.Utiba, serviceName);
            }
            else
            {
                throw new Exception("Problemas identificando el platform");
            }
            //else
            //{
            //    if ((defaultPlatform ?? "0") == "2")
            //        serviceImpl = ServiceProviderFactory.GetServiceProvider(ApiTargetPlatform.Kinacu, serviceName);
            //    else
            //        serviceImpl = ServiceProviderFactory.GetServiceProvider(ApiTargetPlatform.Utiba, serviceName);
            //}

            SecureProvider secureprovider = new SecureProvider(_securemode, serviceImpl, typeof(K), platform);

            return((K)secureprovider.PerformOperation(request));
        }
コード例 #2
0
        public override K ResolveRequest(T request, ApiTargetPlatform targetPlatform, ApiServiceName serviceName)
        {
            //TODO herencia
            // BeginResolveRequest(request, ref targetPlatform, serviceName);

            IServiceProvider serviceImpl = ServiceProviderFactory.GetServiceProvider(targetPlatform, serviceName);

            SecureProvider secureprovider = new SecureProvider(_securemode, serviceImpl, typeof(K), targetPlatform);

            return((K)secureprovider.PerformOperation(request));
        }