public async Task <IActionResult> PutDTCTechnical(string id, DTCTechnical dTCTechnical) { if (id != dTCTechnical.ReferenceNum) { return(BadRequest()); } _context.Entry(dTCTechnical).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DTCTechnicalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <DTCTechnical> > PostDTCTechnical(DTCTechnical dTCTechnical) { _context.DTCTechnical.Add(dTCTechnical); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (DTCTechnicalExists(dTCTechnical.ReferenceNum)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetDTCTechnical", new { id = dTCTechnical.ReferenceNum }, dTCTechnical)); }