public async Task <ActionResult <AgesInfo> > PostAgesInfo(AgesInfo agesInfo) { _context.AgesInfos.Add(agesInfo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAgesInfo", new { id = agesInfo.Id }, agesInfo)); }
public async Task <IActionResult> PutAgesInfo(long id, AgesInfo agesInfo) { if (id != agesInfo.Id) { return(BadRequest()); } _context.Entry(agesInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AgesInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }