public async Task <IActionResult> CreateAsync(string orderId) { var viewModel = new ModifyOrderDetailsViewModel { OrderId = orderId }; var filledViewModel = await _modifyOrderDetailsViewModelFactory.CreateAsync(viewModel); return(View("Create", filledViewModel)); }
public async Task <IActionResult> UpdateAsync(ModifyOrderDetailsViewModel modifyOrderDetailsViewModel) { if (!ModelState.IsValid) { var viewModel = await _modifyOrderDetailsViewModelFactory.CreateAsync(modifyOrderDetailsViewModel); return(View("Update", viewModel)); } var dto = _mapper.Map <OrderDetailsDto>(modifyOrderDetailsViewModel); await _orderDetailsService.UpdateAsync(dto); return(RedirectToAction("ListAsync", "Order")); }
private static ModifyOrderDetailsViewModel CreateModifyOrderDetailsViewModel() { var viewModel = new ModifyOrderDetailsViewModel(); return(viewModel); }