public async Task <IActionResult> Edit(int?id, CancellationToken cancellationToken) { var order = await OrderService.Get(id, cancellationToken); var orderItems = await OrderItemsService.GetAllForOrder(order.Id, cancellationToken); var showModel = ShowViewModel.Create(order, orderItems); ViewBag.Providers = await ProviderService.GetAll(cancellationToken); return(View(showModel)); }
public async Task <IActionResult> Show(int?id, CancellationToken cancellationToken) { if (id == null) { return(RedirectToAction("Index")); } var order = await OrderService.Get(id, cancellationToken); var orderItems = await OrderItemsService.GetAllForOrder(order.Id, cancellationToken); var showModel = ShowViewModel.Create(order, orderItems); return(View(showModel)); }