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