public async Task <IActionResult> Edit(int id, [Bind("MyPizzaPlacesId,Name,Street,Zip,Phone,Votes,TotalVotes,Slogan,Menu")] MyPizzaPlaces myPizzaPlaces) { if (id != myPizzaPlaces.MyPizzaPlacesId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(myPizzaPlaces); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MyPizzaPlacesExists(myPizzaPlaces.MyPizzaPlacesId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(myPizzaPlaces)); }
public async Task <IActionResult> Create([Bind("MyPizzaPlacesId,Name,Street,Zip,Phone,Votes,TotalVotes,Slogan,Menu")] MyPizzaPlaces myPizzaPlaces) { if (ModelState.IsValid) { _context.Add(myPizzaPlaces); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(myPizzaPlaces)); }