Пример #1
0
        public async Task <ActionResult <CopiasItem> > Post(CopiasItem item)
        {
            _context.CopiasItems.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetAutor), new { id = item.Id }, item));
        }
Пример #2
0
        public async Task <IActionResult> Put(int id, CopiasItem item)
        {
            if (id != item.Id)
            {
                return(BadRequest());
            }
            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }