public ActionResult DeleteCustomer(int id) { try { var temp = CManager.GetCustomer(id); if (temp.orderList.Count == 0) { CManager.DeleteCustomer(id); return(NoContent()); } else { return(BadRequest("Orders still linked to customer")); } } catch { return(NotFound("Customer doesn't exist")); } }