private RepositoryResponse<bool> SaveParentPages(int id, MixCmsContext _context, IDbContextTransaction _transaction) { stackVariable0 = new RepositoryResponse<bool>(); stackVariable0.set_IsSucceed(true); V_0 = stackVariable0; V_1 = this.get_Pages().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); V_2.set_PostId(id); V_2.set_Description(this.get_Title()); V_2.set_Image(this.get_ThumbnailUrl()); V_2.set_Status(2); if (!V_2.get_IsActived()) { V_4 = V_2.RemoveModel(false, _context, _transaction); V_0.set_IsSucceed(V_4.get_IsSucceed()); if (V_0.get_IsSucceed()) { dummyVar1 = ViewModelBase<MixCmsContext, MixPage, Mix.Cms.Lib.ViewModels.MixPages.ReadListItemViewModel>.Repository.RemoveCache(V_2.get_Page().get_Model(), _context, _transaction); } else { V_0.set_Exception(V_4.get_Exception()); this.get_Errors().AddRange(V_4.get_Errors()); } } else { V_3 = V_2.SaveModel(false, _context, _transaction); V_0.set_IsSucceed(V_3.get_IsSucceed()); if (V_0.get_IsSucceed()) { dummyVar0 = ViewModelBase<MixCmsContext, MixPage, Mix.Cms.Lib.ViewModels.MixPages.ReadListItemViewModel>.Repository.RemoveCache(V_2.get_Page().get_Model(), _context, _transaction); } else { V_0.set_Exception(V_3.get_Exception()); this.get_Errors().AddRange(V_3.get_Errors()); } } } } finally { ((IDisposable)V_1).Dispose(); } return V_0; }
private RepositoryResponse<bool> SaveRelatedPost(int id, MixCmsContext _context, IDbContextTransaction _transaction) { stackVariable0 = new RepositoryResponse<bool>(); stackVariable0.set_IsSucceed(true); V_0 = stackVariable0; V_1 = this.get_PostNavs().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); V_2.set_SourceId(id); V_2.set_Status(2); V_2.set_Specificulture(this.get_Specificulture()); if (!V_2.get_IsActived()) { V_4 = V_2.RemoveModel(false, _context, _transaction); V_0.set_IsSucceed(V_4.get_IsSucceed()); if (V_0.get_IsSucceed()) { dummyVar1 = ViewModelBase<MixCmsContext, MixPost, Mix.Cms.Lib.ViewModels.MixPosts.ReadViewModel>.Repository.RemoveCache(V_2.get_RelatedPost().get_Model(), null, null); } else { V_0.set_Exception(V_4.get_Exception()); this.get_Errors().AddRange(V_4.get_Errors()); } } else { V_3 = V_2.SaveModel(false, _context, _transaction); V_0.set_IsSucceed(V_3.get_IsSucceed()); if (V_0.get_IsSucceed()) { dummyVar0 = ViewModelBase<MixCmsContext, MixPost, Mix.Cms.Lib.ViewModels.MixPosts.ReadViewModel>.Repository.RemoveCache(V_2.get_RelatedPost().get_Model(), null, null); } else { V_0.set_Exception(V_3.get_Exception()); this.get_Errors().AddRange(V_3.get_Errors()); } } } } finally { ((IDisposable)V_1).Dispose(); } return V_0; }