public async Task <IActionResult> PutDTCHeader(string id, DTCHeader dTCHeader) { if (id != dTCHeader.DTCHeaderId) { return(BadRequest()); } _context.Entry(dTCHeader).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DTCHeaderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <DTCHeader> > PostDTCHeader(DTCHeader dTCHeader) { _context.DTCHeaders.Add(dTCHeader); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDTCHeader", new { id = dTCHeader.Id }, dTCHeader)); }
public async Task <ActionResult <DTCHeader> > PostDTCHeader(DTCHeader dTCHeader) { _context.DTCHeaders.Add(dTCHeader); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (DTCHeaderExists(dTCHeader.DTCHeaderId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetDTCHeader", new { id = dTCHeader.DTCHeaderId }, dTCHeader)); }