public async Task <IActionResult> Edit(int id, [Bind("ID,Naziv,Vrsta,DatSnimanja")] Ptice ptice) { if (id != ptice.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PticeExists(ptice.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptice)); }
public async Task <IActionResult> Create([Bind("ID,Naziv,Vrsta,DatSnimanja")] Ptice ptice) { if (ModelState.IsValid) { _context.Add(ptice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ptice)); }