public async Task <BookChapter> RemoveAsync(Guid id) { BookChapter chapter = await _booksContext.Chapters.SingleOrDefaultAsync(c => c.Id == id); if (chapter == null) { return(null); } _booksContext.Chapters.Remove(chapter); await _booksContext.SaveChangesAsync(); return(chapter); }
public async Task UpdateAsync(BookChapter chapter) { _booksContext.Chapters.Update(chapter); await _booksContext.SaveChangesAsync(); }
public async Task AddAsync(BookChapter chapter) { _logger.LogInformation("BookChaptersRepository AddAsync"); _booksContext.Chapters.Add(chapter); await _booksContext.SaveChangesAsync(); }