public ActionResult Create(int id, CreateOrderViewModel viewModel) { var entity = viewModel.ToEntity(id); var result = _service.Create(entity); if (result.Success) { return RedirectToAction("details", result.Entity.Id); } ModelState.AddModelErrorsFromServiceResult(result); return View(viewModel); }
public ActionResult Create(int id) { var viewModel = new CreateOrderViewModel(id); return View(viewModel); }