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

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