public async Task <IActionResult> PutAuditLine(int id, AuditLineAll auditLineAll) { if (id != auditLineAll.LineId) { return(BadRequest()); } _context.Entry(auditLineAll).State = EntityState.Modified; try { await _context.SaveChangesAsync(); return(Ok(auditLineAll)); } catch (DbUpdateConcurrencyException) { if (!AuditHeaderAllExists(id)) { return(NotFound()); } else { throw; } } }
public async Task <ActionResult <AuditLineAll> > PostAuditDetail(AuditLineAll auditLineAll) { _context.AuditLineAlls.Add(auditLineAll); await _context.SaveChangesAsync(); // return Ok("Successful"); return(CreatedAtAction("PostAuditDetail", new { id = auditLineAll.LineId }, auditLineAll)); }