public async Task <ActionResult <Book> > PostBook([FromBody] Book book)
        {
            _context.Book.Add(book);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBook", new { id = book.Id }, book));
        }
예제 #2
0
 public virtual Task <int> SaveChangesAsync()
 {
     return(_db.SaveChangesAsync());
 }