public ActionResult Create(AccountViewModel account) { if (ModelState.IsValid) { var accountDomain = Mapper.Map<AccountViewModel, Account>(account); _accountAppService.Add(accountDomain); return RedirectToAction("Index"); } return View(account); }
public ActionResult Edit(AccountViewModel accountViewModel) { try { var accountDomain = Mapper.Map<AccountViewModel,Account>(accountViewModel); _accountAppService.Update(accountDomain); return RedirectToAction("Index"); } catch { return View(accountViewModel); } }