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