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