예제 #1
0
        public void Run(string products)
        {
            try
            {
                var totalPrice = _posService.Process(products);

                if (totalPrice != null)
                {
                    Console.WriteLine($"The total is: ${totalPrice}");
                    _logger.LogInformation($"Successfully process products {products}");
                }
                else
                {
                    Console.WriteLine("Please enter valid product list");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in processing products. Please try again later");
                _logger.LogError($"Error Details: {ex.Message}");
            }

            Console.ReadLine();
        }