Example #1
0
        public async Task <ActionResult <LibrosItem> > postLibrosItem(LibrosItem item)
        {
            _context.taskItem.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetLibrosItem), new { ISBN = item.ISBN }, item));
        }
Example #2
0
        public async Task <IActionResult> PutLibrosItem(int ISBN, LibrosItem item)
        {
            if (ISBN != item.ISBN)
            {
                return(BadRequest());
            }
            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }