public async Task <ActionResult> UpdateGere(int bookId, [FromBody] string newGenre) { var book = await _context.Books.Where(b => b.Id == bookId).SingleOrDefaultAsync(); if (book == null) { return(NotFound()); } book.Genre = newGenre; _context.Update(book); await _context.SaveChangesAsync(); return(NoContent()); }
public async Task Update(T entity) { _context.Update(entity); await _context.SaveChangesAsync(); }