private void LoadSubPosts(MixPages.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) { item.PostNavs = item.GetPostNavs(context, transaction); var navPostIds = item.PostNavs.Select(n => n.PostId); var postIds = navPostIds.Where(n => !Posts.Any(m => m.Id == n)); var getPosts = MixPosts.ImportViewModel.Repository.GetModelListBy(m => postIds.Contains(m.Id), context, transaction); if (getPosts.IsSucceed) { Posts.AddRange(getPosts.Data); } }
private void ExportPagePostNav(MixPages.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) { PagePostNavs.AddRange(item.GetPostNavs(context, transaction) .Where(m => !PagePostNavs.Any(n => n.PostId == m.PostId && n.PageId == m.PageId))); foreach (var nav in PagePostNavs) { if (!Posts.Any(m => m.Id == nav.Post.Id && m.Specificulture == Specificulture)) { Posts.Add(nav.Post); } } }
private void LoadSubModules(MixPages.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) { item.ModuleNavs = item.GetModuleNavs(context, transaction); foreach (var nav in item.ModuleNavs) { var dupModule = Modules.FirstOrDefault(m => m.Id == nav.ModuleId && m.Specificulture == Specificulture); if (dupModule != null) { Modules.Remove(dupModule); } else { nav.Module.IsExportData = true; } ProcessModuleData(nav.Module, context, transaction); } }