public async Task <ActionResult <CmLocationInfo> > PostCmLocationInfo(CmLocationInfo cmLocationInfo) { _context.CmLocationInfos.Add(cmLocationInfo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCmLocationInfo", new { id = cmLocationInfo.Id }, cmLocationInfo)); }
public async Task <IActionResult> PutCmLocationInfo(int id, CmLocationInfo cmLocationInfo) { if (id != cmLocationInfo.Id) { return(BadRequest()); } _context.Entry(cmLocationInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CmLocationInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }