public ActionResult Create(CreateLevelViewModel viewModel) { var request = viewModel.MapTo<CreateLevelRequest>(); var response = _levelService.Create(request); TempData["IsSuccess"] = response.IsSuccess; TempData["Message"] = response.Message; if (response.IsSuccess) { return RedirectToAction("Index"); } return View("Create", viewModel); }
public ActionResult Create() { var viewModel = new CreateLevelViewModel(); return View(viewModel); }