public void AttachToRestaurants(Restaurant restaurant)
 {
     this.AttachTo("Restaurants", restaurant);
 }
 public void SetRestaurantModel(Restaurant restaurant = null)
 {
     if (restaurant == null)
     {
         this.Restaurant = new Restaurant();
         try
         {
             this.Context.AddToRestaurants(this.Restaurant);
         }
         catch (Exception exception)
         {
             var errorMessage = StorageClientExceptionParser.ParseDataServiceException(exception).Message;
             this.Message = string.Format(CultureInfo.InvariantCulture, "Error: {0}", errorMessage);
         }
     }
     else
     {
         this.Restaurant = restaurant;
         this.Restaurant.PropertyChanged += this.OnUpdateRestaurant;
     }
 }
 public void AddToRestaurants(Restaurant restaurant)
 {
     this.AddObject("Restaurants", restaurant);
 }