public async Task <IActionResult> PutGsUserSetting(int id, GsUserSetting gsUserSetting) { if (id != gsUserSetting.UserId) { return(BadRequest()); } _context.Entry(gsUserSetting).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GsUserSettingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <GsUserSetting> > PostGsUserSetting(GsUserSetting gsUserSetting) { _context.GsUserSettings.Add(gsUserSetting); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (GsUserSettingExists(gsUserSetting.UserId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetGsUserSetting", new { id = gsUserSetting.UserId }, gsUserSetting)); }