public IHttpActionResult PutCustomer_Order_Line(int id, Customer_Order_Line customer_Order_Line) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != customer_Order_Line.Customer_Order_ID) { return(BadRequest()); } db.Entry(customer_Order_Line).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Customer_Order_LineExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCustomer_Order_Line(int id) { Customer_Order_Line customer_Order_Line = db.Customer_Order_Line.Find(id); if (customer_Order_Line == null) { return(NotFound()); } return(Ok(customer_Order_Line)); }
public IHttpActionResult PostCustomer_Order_Line(Customer_Order_Line customer_Order_Line) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Customer_Order_Line.Add(customer_Order_Line); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = customer_Order_Line.Customer_Order_ID }, customer_Order_Line)); }
public IHttpActionResult DeleteCustomer_Order_Line(int id) { Customer_Order_Line customer_Order_Line = db.Customer_Order_Line.Find(id); if (customer_Order_Line == null) { return(NotFound()); } db.Customer_Order_Line.Remove(customer_Order_Line); db.SaveChanges(); return(Ok(customer_Order_Line)); }