Exemplo n.º 1
0
        public async Task <ActionResult <CQItem> > PostCQItem(CQItem item)
        {
            _context.CQItems.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetCQItem), new CQItem {
                id = item.id
            }, item));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutCQItem(long id, CQItem item)
        {
            if (id != item.id)
            {
                return(BadRequest());
            }
            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }