public FruitBasket GetFruitBasket(int fruitBasketId)
        {
            //var db = new DBContext();

            if (fruitBasketId == 0 )
            {
                FruitBasket temp2 = new FruitBasket();
                return temp2;
            }

            FruitBasket temp = new FruitBasket();
            temp = (from b in db.FruitBasketList
                    where b.FruitBasketId == fruitBasketId
                    select b).FirstOrDefault();
            return temp;
        }
        public ViewResult ShowExampleFruitBasket()
        {
            FruitBasket temp = new FruitBasket();
            temp.AppleList.Add(new Apple() { AppleId = 1, Color = "Red", Type = "Delicious" });
            temp.AppleList.Add(new Apple() { AppleId = 2, Color = "Blue", Type = "SortaDelicious" });
            temp.AppleList.Add(new Apple() { AppleId = 3, Color = "Green", Type = "VeryDelicious" });
            temp.BananaList.Add(new Banana() { BananaId = 1, Color = "Yellow", NumberOfSpots = 6 });
            temp.GrapesList.Add(new Grapes() { GrapesId = 1, Color = "purple" });
            temp.KiwiList.Add(new Kiwi() { KiwiId = 1, Type = "Saanichton 12" });
            temp.KiwiList.Add(new Kiwi() { KiwiId = 2, Type = "Saanichton 12" });
            temp.MelonList.Add(new Melon() { MelonId = 1, Color = "orange", Type = "cantalope" });
            temp.OrangeList.Add(new Orange() { OrangeId = 1, Color = "orange", Type = "Blood" });

            return View("ShowNewFruitBasket", temp);
        }
 public void AddFruitBasket(FruitBasket fruitBasket)
 {
     //var db = new DBContext();
     db.FruitBasketList.Add(fruitBasket);
     db.SaveChanges();
 }
 //zomg layers
 //public void SaveFruitBasket(FruitBasketViewModelNope fruitBasketVM)
 //{
 //    if (fruitBasketVM.FruitBasket.FruitBasketId == 0)
 //    {
 //        //add a new fruit basket to the user
 //        RegisteredUser RUser = db.RegisteredUserList.Find(fruitBasketVM.RegisteredUser.Password);
 //        RUser.FruitBasketList.Add(fruitBasketVM.FruitBasket);
 //    }
 //    else
 //    {
 //        //update the existing fruitbasket
 //        RegisteredUser RUser = db.RegisteredUserList.Find(fruitBasketVM.RegisteredUser.Password);
 //        var RUserSelectedFruitBasket = ((from b in RUser.FruitBasketList
 //            where b.FruitBasketId == fruitBasketVM.FruitBasket.FruitBasketId
 //            select b).FirstOrDefault());
 //        if (RUserSelectedFruitBasket != null)
 //        {
 //            //var temp2 = RUser.FruitBasketList.Find(x => x.FruitBasketId == temp.FruitBasketId);
 //            RUserSelectedFruitBasket.AppleList = fruitBasketVM.FruitBasket.AppleList;
 //            RUserSelectedFruitBasket.BananaList = fruitBasketVM.FruitBasket.BananaList;
 //            RUserSelectedFruitBasket.GrapesList = fruitBasketVM.FruitBasket.GrapesList;
 //            RUserSelectedFruitBasket.KiwiList = fruitBasketVM.FruitBasket.KiwiList;
 //            RUserSelectedFruitBasket.MelonList = fruitBasketVM.FruitBasket.MelonList;
 //            RUserSelectedFruitBasket.OrangeList = fruitBasketVM.FruitBasket.OrangeList;
 //        }
 //    }
 //    db.SaveChanges();
 //}
 public void SaveFruitBasket2(FruitBasket fruitBasket)
 {
     if (fruitBasket.FruitBasketId == 0)
     {
         db.FruitBasketList.Add(fruitBasket);
     }
     else
     {
         FruitBasket dbEntry = db.FruitBasketList.Find(fruitBasket.FruitBasketId);
         if (dbEntry != null)
         {
             dbEntry.AppleList = fruitBasket.AppleList;
         }
     }
     db.SaveChanges();
 }
 //Implemmented interface methods
 public void AddFruitBasket(FruitBasket fruitBasket)
 {
     fruitBasketList.Add(fruitBasket);
 }
 //public void SaveFruitBasket(Entities.FruitBasketViewModelNope fruitBasketVM)
 //{
 //    throw new NotImplementedException();
 //}
 public void SaveFruitBasket2(FruitBasket fruitBasket)
 {
     throw new NotImplementedException();
 }