Ejemplo n.º 1
0
        public async Task <IActionResult> PutAdminTemplate(int id, AdminTemplate AdminTemplate)
        {
            if (id != AdminTemplate.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutMyNewScreen(int id, MyNewScreen myNewScreen)
        {
            if (id != myNewScreen.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }