public async Task <IActionResult> PutElocks(long id, Elocks elocks) { if (id != elocks.ElocksId) { return(BadRequest()); } _context.Entry(elocks).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ElocksExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Elocks> > PostElocks(Elocks elocks) { _context.Elocks.Add(elocks); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ElocksExists(elocks.ElocksId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetElocks", new { id = elocks.ElocksId }, elocks)); }