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