Ejemplo n.º 1
0
        public async Task <IActionResult> PutUsuario(string id, Usuario usuario)
        {
            if (id != usuario.Usuario1)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutPlato(decimal id, Plato plato)
        {
            if (id != plato.PlatosId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> PutMusicaAgrupacione(decimal id, MusicaAgrupacione musicaAgrupacione)
        {
            if (id != musicaAgrupacione.MusicaId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }