Exemplo n.º 1
0
        public async Task <IActionResult> PutPiecesJointesEvents(int id, PiecesJointesEvents piecesJointesEvents)
        {
            if (id != piecesJointesEvents.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <PiecesJointesEvents> > PostPiecesJointesEvents(PiecesJointesEvents piecesJointesEvents)
        {
            _context.piecesJointesEvents.Add(piecesJointesEvents);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPiecesJointesEvents", new { id = piecesJointesEvents.Id }, piecesJointesEvents));
        }