Exemple #1
0
        public async Task <IActionResult> PutUniversidad(int id, Universidad universidad)
        {
            if (id != universidad.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #2
0
        public async Task <IActionResult> PutPaise(int id, Paise paise)
        {
            if (id != paise.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }