public async Task <IActionResult> Edit(int id, [Bind("Id,LocationName,LocationType,Choice,Yes,No")] RunningSpot runningSpot) { if (id != runningSpot.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(runningSpot); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RunningSpotExists(runningSpot.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(runningSpot)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Address,Lat,Lng,Type")] Map map) { if (id != map.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(map); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapExists(map.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.Runningspot, "Id", "Choice", map.Id); return(View(map)); }