Пример #1
0
        public async Task <IActionResult> PutGsAppSetting(int id, GsAppSetting gsAppSetting)
        {
            if (id != gsAppSetting.AppId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Пример #2
0
        public async Task <ActionResult <GsAppSetting> > PostGsAppSetting(GsAppSetting gsAppSetting)
        {
            _context.GsAppSettings.Add(gsAppSetting);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (GsAppSettingExists(gsAppSetting.AppId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetGsAppSetting", new { id = gsAppSetting.AppId }, gsAppSetting));
        }