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