コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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);
         }
     }
 }
コード例 #3
0
 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);
     }
 }