public async Task <IActionResult> Edit(int id, [Bind("Id,RazaoSocial,Endereco")] Loja loja) { if (id != loja.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(loja); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LojaExists(loja.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(loja)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Descricao")] Bairro bairro) { if (id != bairro.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bairro); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BairroExists(bairro.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bairro)); }