public async Task <IActionResult> PutImportInvoiceDetail(string id, ImportInvoiceDetail importInvoiceDetail) { if (id != importInvoiceDetail.Id) { return(BadRequest()); } _context.Entry(importInvoiceDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ImportInvoiceDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ImportInvoiceDetail> > PostImportInvoiceDetail(ImportInvoiceDetail importInvoiceDetail) { _context.ImportInvoiceDetail.Add(importInvoiceDetail); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ImportInvoiceDetailExists(importInvoiceDetail.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetImportInvoiceDetail", new { id = importInvoiceDetail.Id }, importInvoiceDetail)); }