public ActionResult Edit(GallaryViewModel model) { if (ModelState.IsValid) { var gallary = mapper.Map <tblGallary>(model); gallaryService.Update(gallary); return(RedirectToAction("Index")); } return(Edit(model.Id)); }
public ActionResult Create(GallaryViewModel model, HttpPostedFileBase imageFile) { if (ModelState.IsValid) { var gallary = mapper.Map <tblGallary>(model); gallary.ImageLink = SaveImage(imageFile); gallaryService.AddGallary(gallary); return(RedirectToAction("Index")); } return(Create()); }