public async Task <ActionResult <Orderline9144> > PostOrderline9144(Orderline9144 ol) { // _context.Orderline9144.Add(ol); try { _context.Orderline9144.FromSqlRaw("EXEC ADD_PRODUCT_TO_ORDER @PORDERID = " + ol.Orderid + ", @PPRODIID = " + ol.Productid + ", @PQTY = " + ol.Quantity + ", @DISCOUNT = " + ol.Discount); await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (Orderline9144Exists(ol.Orderid)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetOrderline9144", new { id = ol.Orderid }, ol)); }
public async Task <IActionResult> PutOrderline9144(int id, Orderline9144 orderline9144) { if (id != orderline9144.Orderid) { return(BadRequest()); } _context.Entry(orderline9144).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Orderline9144Exists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }