public async Task <IActionResult> Edit(int id, [Bind("Id,ZvanjaMi,BodoviMi,BodoviVi,ZvanjaVi,PartijaId")] Bela bela) { if (id != bela.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bela); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BelaExists(bela.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PartijaId"] = new SelectList(_context.Partija, "Id", "Naziv", bela.PartijaId); return(View(bela)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Naziv")] Partija partija) { if (id != partija.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(partija); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PartijaExists(partija.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(partija)); }