public async Task <IActionResult> PutPersona(int id, Persona persona)
        {
            if (id != persona.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#2
0
        public async Task <IActionResult> PutAfiliacion(int id, Afiliacion afiliacion)
        {
            if (id != afiliacion.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }