public async Task <IActionResult> Edit(int id, [Bind("Id,PhoneNumber,Nickname,Description,Address")] DowolnaKlasaModel dowolnaKlasaModel) { if (id != dowolnaKlasaModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dowolnaKlasaModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DowolnaKlasaModelExists(dowolnaKlasaModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dowolnaKlasaModel)); }
public async Task <IActionResult> Create([Bind("Id,PhoneNumber,Nickname,Description,Address")] DowolnaKlasaModel dowolnaKlasaModel) { if (ModelState.IsValid) { _context.Add(dowolnaKlasaModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dowolnaKlasaModel)); }