public async Task <IActionResult> PutEradiusChanges(long id, EradiusChanges eradiusChanges) { if (id != eradiusChanges.EradiusChangesId) { return(BadRequest()); } _context.Entry(eradiusChanges).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EradiusChangesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EradiusChanges> > PostEradiusChanges(EradiusChanges eradiusChanges) { _context.EradiusChanges.Add(eradiusChanges); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EradiusChangesExists(eradiusChanges.EradiusChangesId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEradiusChanges", new { id = eradiusChanges.EradiusChangesId }, eradiusChanges)); }