public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] City city) { if (id != city.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(city); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CityExists(city.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(city)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,PhotoPath,Heading,Title,Link")] Ad ad) { if (id != ad.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ad); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdExists(ad.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ad)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Logo,Phone,Email,Description,Facebook,Twitter,Instagram")] Setting setting) { if (id != setting.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(setting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SettingExists(setting.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(setting)); }