public async Task <IActionResult> PutSolicitudAdopcion([FromRoute] int id, [FromBody] SolicitudAdopcion solicitudAdopcion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != solicitudAdopcion.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PutClinicaVeterianaria([FromRoute] int id, [FromBody] ClinicaVeterianaria clinicaVeterianaria)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != clinicaVeterianaria.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }