예제 #1
0
        public async Task Delete(int id)
        {
            var book = await _dbContext.Categories.FindAsync(id);

            _dbContext.Remove(book);
            await _dbContext.SaveChangesAsync();
        }
예제 #2
0
        public async Task Delete(int bookId)
        {
            var book = await _dbContext.Books.FindAsync(bookId);

            _dbContext.Remove(book);
            await _dbContext.SaveChangesAsync();
        }
예제 #3
0
        public void Delete(int bookId)
        {
            var book = _dbContext.Books.Find(bookId);

            _dbContext.Remove(book);
            _dbContext.SaveChanges();
        }