public async Task <IActionResult> PutMstSettings([FromRoute] int id, [FromBody] MstSettings mstSettings) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstSettings.SettingId) { return(BadRequest()); } _context.Entry(mstSettings).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstSettingsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstSettings([FromBody] MstSettings mstSettings) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstSettings.Add(mstSettings); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstSettings", new { id = mstSettings.SettingId }, mstSettings)); }