public async Task <IActionResult> PutEelectrificationChanges(long id, EelectrificationChanges eelectrificationChanges) { if (id != eelectrificationChanges.EelectrificationChangesId) { return(BadRequest()); } _context.Entry(eelectrificationChanges).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EelectrificationChangesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EelectrificationChanges> > PostEelectrificationChanges(EelectrificationChanges eelectrificationChanges) { _context.EelectrificationChanges.Add(eelectrificationChanges); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EelectrificationChangesExists(eelectrificationChanges.EelectrificationChangesId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEelectrificationChanges", new { id = eelectrificationChanges.EelectrificationChangesId }, eelectrificationChanges)); }