public ActionResult Create(BannerViewModel banner) { try { _bannerFacade.Add(banner); return RedirectToAction("Index"); } catch (Exception ex) { ModelState.AddModelError("", ex.InnerException.Message); return View(); } }
private BannerEntity BannerConvert(BannerViewModel banner) { var newBanner = _typeAdapter.Adapt<BannerViewModel, BannerEntity>(banner); return newBanner; }
public void Update(BannerViewModel banner) { var newBanner = BannerConvert(banner); _bannerRepository.Update(newBanner); _uow.SaveChanges(); }