public IActionResult CompleteOrder(int id) { var order = _ordersRepo.GetOrderById(id); if (order == null) { return(View("StatusCodes/OrderNotFound")); } order.IsCompleted = true; if (!_ordersRepo.SaveChanges()) { return(BadRequest()); } return(RedirectToAction("Get", "Orders")); }
public IOrder GetById(int id) { return(_ordersRepo.GetOrderById(id)); }