public ActionResult AddDinner()
{
Dinner dinner = dinnerRepository.GetDinner(id);
ViewData["dinner"] = repository.AllDinners();
return View(dinner);
}
1) First, are both the dinner object and the ViewData["dinner"] is passing to the view?
2) Second, how would I iterate over the ViewData["dinner"] in the view?
dinnervariable name or the key of theViewDataitem. (Unless they contain the same thing.) Using the same name makes it hard to understand the question: imagine how much harder it will be to read your view's code.