public async Task <ActionResult <AnnualOrderDetail> > PostAnnualOrderDetail(AnnualOrderDetail annualOrderDetail) { _context.AnnualOrderDetail.Add(annualOrderDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAnnualOrderDetail", new { id = annualOrderDetail.AnnualOrderDetailId }, annualOrderDetail)); }
public async Task <IActionResult> PutAnnualOrderDetail(int id, AnnualOrderDetail annualOrderDetail) { if (id != annualOrderDetail.AnnualOrderDetailId) { return(BadRequest()); } _context.Entry(annualOrderDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AnnualOrderDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }