public async Task <IActionResult> PostGrossInternationalReserve([FromBody] GrossInternationalReserve grossInternationalReserve) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.GrossInternationalReserves.Add(grossInternationalReserve); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGrossInternationalReserve", new { id = grossInternationalReserve.ID }, grossInternationalReserve)); }
public async Task <IActionResult> PutGrossInternationalReserve([FromRoute] int id, [FromBody] GrossInternationalReserve grossInternationalReserve) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != grossInternationalReserve.ID) { return(BadRequest()); } _context.Entry(grossInternationalReserve).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GrossInternationalReserveExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }