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 #3
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);
        }
Exemple #4
0
        public void Run()
        {
            DotNetCoreWCF.Contracts.Model.Employees.EmployeeResponse response = null;

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

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