public RestaurantOption SaveOrUpdate(RestaurantOption entity)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         if (entity.Id > 0)
         {
             _connection.Update(entity);
         }
         else
         {
             int insert = _connection.Insert(entity);
             entity.Id = insert;
         }
         return entity;
     }
 }
        public IEnumerable<RestaurantOption> GetAndSaveOptions()
        {
            var options = GetAllByDate(null).ToList();

            if (!options.Any())
            {
                options = new List<RestaurantOption>();
                var restaurants = _restaurantLogic.GetSelection().ToList();
                foreach (var restaurant in restaurants)
                {
                    var option = new RestaurantOption {RestaurantId = restaurant.Id, Selected = 0, SelectedDate = DateTime.Now};
                    option.Restaurant = restaurant;
                    options.Add(option);
                    SaveOrUpdate(option);
                }
            }

            return options;
        }
 public RestaurantOption SaveOrUpdate(RestaurantOption entity)
 {
     return _restaurantOptionRepository.SaveOrUpdate(entity);
 }