示例#1
0
文件: Mapper.cs 项目: BasGo/Foodle
 public static Restaurant Map(RestaurantElement restaurant)
 {
     var result = new Restaurant
         {
             Name = restaurant.Name,
             Days = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), GetWeekdayEnum(restaurant.Days))
         };
     return result;
 }
示例#2
0
        public void Add(Restaurant restaurant, int points)
        {
            if (_items == null)
                _items = new Dictionary<string, int>();

            if (!_items.ContainsKey(restaurant.Name))
                _items.Add(restaurant.Name, 0);

            _items[restaurant.Name] += points;
        }