public IFacadeUpdateResult <FolderData> SaveSubsiteBatch(FolderTreeData folderTree, SubsiteData subSite) { UnitOfWork.BeginTransaction(); // 1. Save parent folder folderTree.Folder.IsSubsiteRoot = true; FacadeUpdateResult <FolderData> result = SaveFolderTree(folderTree); if (result.IsSuccessful) { // 2. Save SubsiteData subSite.SubsiteFolderId = result.Result.Id; IFacadeUpdateResult <SubsiteData> subSiteResult = SubsiteSystem.SaveSubsite(subSite); result.ValidationResult.Merge(subSiteResult.ValidationResult); if (subSiteResult.IsSuccessful) { UnitOfWork.CommitTransaction(); } else { UnitOfWork.RollbackTransaction(); } } else { UnitOfWork.RollbackTransaction(); } return(result); }
public SubsiteBatchFacade(IUnitOfWork unitOfWork) : base(unitOfWork) { FolderSystem = new FolderSystem(unitOfWork); SubsiteSystem = new SubsiteSystem(unitOfWork); ReferenceSystem = new ReferenceSystem(unitOfWork); SubitemValueSystem = new SubitemValueSystem(UnitOfWork); }
public SubsiteFacade(IUnitOfWork unitOfWork) : base(unitOfWork) { SubsiteSystem = new SubsiteSystem(unitOfWork); }