public async Task <IActionResult> PutEpantograph(short id, Epantograph epantograph) { if (id != epantograph.EpantographId) { return(BadRequest()); } _context.Entry(epantograph).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EpantographExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Epantograph> > PostEpantograph(Epantograph epantograph) { _context.Epantograph.Add(epantograph); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EpantographExists(epantograph.EpantographId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEpantograph", new { id = epantograph.EpantographId }, epantograph)); }