コード例 #1
0
        /// <summary>
        ///     Returns the current menu of the given restaurant.
        /// </summary>
        /// <param name="restaurantCommand"></param>
        /// <returns></returns>
        public string GetMenu(string restaurantCommand)
        {
            IRestaurant restaurant = _restaurants.Find(x => x.GetCommand().Equals(restaurantCommand));

            if (restaurant == null)
            {
                throw new Exception("Unknown restaurant: " + restaurantCommand.Substring(0, 100));
            }

            StatisticsCollector.GetInstance().IncrementExecutedRestaurantMenuRequestCount();

            _log.Info("Getting menu of restaurant: " + restaurant.GetName());

            return(restaurant.GetCurrentMenu());
        }