public static HP_PhotoSliderViewModel MapToPhotoSliderViewModel(this HomePagePhotoSliderVersion viewModel) { return(new HP_PhotoSliderViewModel() { Id = viewModel.Id, ArDescription = viewModel.ArDescription, EnDescription = viewModel.EnDescription, ImageUrl = viewModel.ImageUrl, IsActive = viewModel.IsActive, IsDeleted = viewModel.IsDeleted, Url = viewModel.Url, ArTitle = viewModel.ArTitle, EnTitle = viewModel.EnTitle, ChangeActionEnum = viewModel.ChangeActionEnum, VersionStatusEnum = viewModel.VersionStatusEnum, HomePagePhotoSliderId = viewModel.HomePagePhotoSliderId, ApprovedById = viewModel.ApprovedById, CreatedById = viewModel.CreatedById, ApprovalDate = viewModel.ApprovalDate, CreationDate = viewModel.CreationDate, ModifiedById = viewModel.ModifiedById, ModificationDate = viewModel.ModificationDate, }); }
public void Update(HomePagePhotoSliderVersion homePagePhotoSlider) { _db.HomePagePhotoSliderVersions.Update(homePagePhotoSlider); _db.SaveChanges(); }
public void Add(HomePagePhotoSliderVersion photoSlider) { _db.HomePagePhotoSliderVersions.Add(photoSlider); _db.SaveChanges(); //_db.Entry(photoSlider).State = EntityState.Detached; }