コード例 #1
0
        /// <summary>
        /// Retorna una instancia singleton del cliente de INFINITUS.
        /// </summary>
        /// <param name="cliente">The cliente.</param>
        /// <returns>cliente INFINITUS.</returns>
        public static IINFINITUSClient InfinitusClient(ClienteRest cliente)
        {
            {
                if (infinitusClient == null)
                {
                    lock (syncRoot)
                    {
                        if (infinitusClient != null)
                        {
                            return(infinitusClient);
                        }

                        var client = new INFINITUSClient(
                            new Uri(cliente.Endpoint),
                            // new TokenCredentials(tokenProvider),
                            Token,
                            new WebRequestHandler()
                        {
                            CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default)
                        },
                            new CorrelationHandler());

                        client.SetRetryPolicy(null);

                        infinitusClient = client;
                    }
                }

                return(infinitusClient);
            }
        }
コード例 #2
0
        /// <summary>
        /// Initialize.
        /// </summary>
        /// <param name="builder">containerBuilder.</param>
        /// <returns>bool.</returns>
        protected override bool Initialize(ContainerBuilder builder)
        {
            var errores = this.parametros.ParseParametros(this.argumentos.Parametros);

            if (errores.Count > 0)
            {
                foreach (var error in errores)
                {
                    this.AddDetail("Error parseando parametros", EstadoDetalle.Error);
                }

                return(false);
            }

            errores = this.parametros.ValidarParametros();
            if (errores.Count > 0)
            {
                foreach (var error in errores)
                {
                    this.AddDetail("Error validando parametros", EstadoDetalle.Error);
                }

                return(false);
            }

            this.clienINFINITUS = RestClientStore.InfinitusClient(this.argumentos.Apar);

            this.ConfigurarAutoFac(builder);

            return(true);
        }