Ejemplo n.º 1
0
        public async Task <IActionResult> PutPjpk(int id, Pjpk pjpk)
        {
            if (id != pjpk.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <Pjpk> > PostPjpk(Pjpk pjpk)
        {
            _context.Pjpk.Add(pjpk);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (PjpkExists(pjpk.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetPjpk", new { id = pjpk.Id }, pjpk));
        }