public async Task <IActionResult> Edit(int id, [Bind("ID,Artist,Title,Genre,Play")] ReadingCoding readingCoding) { if (id != readingCoding.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(readingCoding); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReadingCodingExists(readingCoding.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(readingCoding)); }
public async Task <IActionResult> Create([Bind("ID,Artist,Title,Genre,Play")] ReadingCoding readingCoding) { if (ModelState.IsValid) { _context.Add(readingCoding); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(readingCoding)); }