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