Exemplo n.º 1
0
        public async Task <ActionResult <Referenciel> > PostReferenciel(Referenciel referenciel)
        {
            _context.Referenciel.Add(referenciel);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetReferenciel", new { id = referenciel.Id }, referenciel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutReferenciel(int id, Referenciel referenciel)
        {
            if (id != referenciel.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }