public ActionResult FoodRecipe(int id) { //RecipeDetails rd = new RecipeDetails(); //rd.FoodVal = c.Foods.Where(x => x.FoodId == id).ToList(); //rd.CategoryVal = c.Categories.Where(x => x.CategoryId == id).ToList(); //rd.DifficultyVal = c.Difficulties.Where(x => x.DifficultyId == id).ToList(); //rd.IngredientVal = c.Ingredients.Where(x => x.IngredientsId == id).ToList(); //rd.MealVal = c.Meals.Where(x => x.MealId == id).ToList(); var foodList = fm.List(); //var foodListID = fm.List().Where(x=>x.FoodId==id).SingleOrDefault(); //var foodID = fm.GetByID(id); ViewBag.ID = fm.GetByID(id).FoodId; return(View(foodList)); }