public void Run()
        {
            _logger.LogInformation("Running WcfGeneratedServiceDemo");
            _logger.LogInformation("*******************************");

            Contracts.Model.Employees.EmployeeResponse response = null;

            try
            {
                using (var client = new EmployeeServiceClient())
                {
                    response = AsyncHelper.RunSync(() => client.GetAsync(new Contracts.Model.Employees.EmployeeRequest {
                        ActiveOnly = true
                    }));
                }

                _logger.LogInformation($"Employees found: {response?.Employees.Length}");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Oh noes!");
            }

            _logger.LogInformation("End WcfGeneratedServiceDemo");
            _logger.LogInformation("*******************************");
        }
        public void Run()
        {
            _logger.LogInformation("Running FactoryEmployeeClientDemo");
            _logger.LogInformation("*******************************");

            Contracts.Model.Employees.EmployeeResponse response = null;

            try
            {
                using (var client = _clientFactory.GetClient(ClientType.ChannelFactory))
                {
                    response = client.Get(new Contracts.Model.Employees.EmployeeRequest {
                        ActiveOnly = true
                    });
                }

                _logger.LogInformation($"Employees found: {response?.Employees.Length}");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Oh noes!");
            }

            _logger.LogInformation("End FactoryEmployeeClientDemo");
            _logger.LogInformation("*******************************");
        }
        public void Run()
        {
            _logger.LogInformation("Running AutomaticConfigurationDemo; this demo is expected to fail");
            _logger.LogInformation("*******************************");

            Contracts.Model.Employees.EmployeeResponse response = null;

            try
            {
                using (var client = _clientFactory.GetClient())
                {
                    response = client.Get(new Contracts.Model.Employees.EmployeeRequest {
                        ActiveOnly = true
                    });
                }

                _logger.LogInformation($"Employees found: {response?.Employees.Length}");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Oh noes!");
            }

            _logger.LogInformation("End AutomaticConfigurationDemo");
            _logger.LogInformation("*******************************");
        }
Exemple #4
0
        public int Run()
        {
            Contracts.Model.Employees.EmployeeResponse response = null;

            try
            {
                using (var client = _clientFactory.GetClient(ClientType.ChannelFactory))
                {
                    response = client.Get(new Contracts.Model.Employees.EmployeeRequest {
                        ActiveOnly = true
                    });
                }
                return(response.Employees.Length);
            }
            catch (Exception ex)
            {
            }
            return(0);
        }