public static bool AddFavoriteComponent(FavoriteComponent favoriteComponent)
 {
     lock (dcc)
     {
         try
         {
             dcc.FavoriteCompontents.Add(favoriteComponent);
             dcc.SaveChanges();
             return true;
         }
         catch (Exception) { }
         return false; 
     }
 }
 private static Meal DownloadMeal(FavoriteComponent favoriteComponent)
 {
     return (from meal in dcc.Meals where meal.MealId == favoriteComponent.MealId select meal).First();
 }
Пример #3
0
 public WcfFavoriteComponent(FavoriteComponent favoriteComponent)
 {
     this.Quantity = favoriteComponent.Quantity;
     this.Meal = new WcfMeal(favoriteComponent.Meal);
 }