public async Task <IActionResult> Edit(Guid id, [Bind("Id,name,author,dateCompleted")] Book book) { if (id != book.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(book); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookExists(book.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(book)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Author,Genre,Pages,ReleaseDate,FinishedReading")] Book book) { if (id != book.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(book); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookExists(book.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(book)); }
public async Task Update(Book book) { _context.Update(book); await _context.SaveChangesAsync(); }
public async Task Update(Autor author) { _context.Update(author); await _context.SaveChangesAsync(); }
public async Task Update(Purchase purchase) { _context.Update(purchase); await _context.SaveChangesAsync(); }