public ActionResult Edit_order(int id, Order new_order) { if (ModelState.IsValid) { int res = logic_operations.Edit_order(id, new_order); switch (res) { case 404: return(NotFound()); case 203: return(Ok(new { status = res, message = status_list[res] })); case 401: return(BadRequest(new { status = res, message = status_list[res] })); } } return(BadRequest(new { status = 402, message = "message: Bad Order data." })); }
public ActionResult Edit_order(int id, Order new_order) { if (ModelState.IsValid) { int res = logic_operations.Edit_order(id, new_order); switch (res) { case 404: return(NotFound()); case 203: return(Ok($"status: {res} " + $"message: {status_list[res]}")); case 401: return(BadRequest($"status: {res} " + $"message: {status_list[res]}")); } } return(BadRequest($"status: 402 " + $"message: Bad Order data.")); }