public RemoveAsync ( System.Guid id ) : Task |
||
id | System.Guid | |
Résultat | Task |
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;
}