Exemplo n.º 1
0
        public async Task <IActionResult> PutPrototypeTable(int id, PrototypeTable prototypeTable)
        {
            if (id != prototypeTable.PrototypePk)
            {
                return(BadRequest());
            }

            _context.Entry(prototypeTable).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PrototypeTableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <PrototypeTable> > PostPrototypeTable(PrototypeTable prototypeTable)
        {
            _context.PrototypeTable.Add(prototypeTable);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (PrototypeTableExists(prototypeTable.PrototypePk))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetPrototypeTable", new { id = prototypeTable.PrototypePk }, prototypeTable));
        }