public async Task Delete(int id) { var book = await _dbContext.Categories.FindAsync(id); _dbContext.Remove(book); await _dbContext.SaveChangesAsync(); }
public async Task Delete(int bookId) { var book = await _dbContext.Books.FindAsync(bookId); _dbContext.Remove(book); await _dbContext.SaveChangesAsync(); }
public void Delete(int bookId) { var book = _dbContext.Books.Find(bookId); _dbContext.Remove(book); _dbContext.SaveChanges(); }