Esempio n. 1
0
        public async Task <ActionResult <Ppar> > PostPpar(Ppar ppar)
        {
            _context.Ppar.Add(ppar);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPpar", new { id = ppar.PparId }, ppar));
        }
Esempio n. 2
0
        public async Task <IActionResult> PutPpar(int id, Ppar ppar)
        {
            if (id != ppar.PparId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }