public static void UpdateCinemaFeature(this CinemaFeature cinemaFeature, CinemaFeatureViewModel cinemaFeatureViewModel) { //cinemaFeature.FeatureID = cinemaFeatureViewModel.FeatureID; cinemaFeature.FeatureType = cinemaFeatureViewModel.FeatureType; cinemaFeature.FeatureContent = cinemaFeatureViewModel.FeatureContent; cinemaFeature.FeatureDescription = cinemaFeatureViewModel.FeatureDescription; cinemaFeature.CreatedDate = cinemaFeatureViewModel.CreatedDate; cinemaFeature.CreatedBy = cinemaFeatureViewModel.CreatedBy; cinemaFeature.UpdatedDate = cinemaFeatureViewModel.UpdatedDate; cinemaFeature.UpdatedBy = cinemaFeatureViewModel.UpdatedBy; cinemaFeature.MetaKeyword = cinemaFeatureViewModel.MetaKeyword; cinemaFeature.MetaDescription = cinemaFeatureViewModel.MetaDescription; }
public ActionResult Create(CinemaFeatureViewModel cinemaFeatureViewModel) { if (ModelState.IsValid) { cinemaFeatureViewModel.CreatedDate = DateTime.Now; CinemaFeature cinemaFeature = new CinemaFeature(); cinemaFeature.UpdateCinemaFeature(cinemaFeatureViewModel); if (cinemaFeature != null) { _cinemaFeatureService.Add(cinemaFeature); _cinemaFeatureService.SaveChanges(); return(RedirectToAction(("Index"))); } } return(RedirectToAction("Create")); }