public async Task <BooksModel> UpdateBook(BooksModel bookModel) { _context.Attach(bookModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); return(bookModel); } catch (DbUpdateConcurrencyException) { if (!BookModelExists(bookModel.ID)) { return(bookModel); } else { throw; } } }