예제 #1
0
        private async Task <bool> HandleResourceUpdateAsync(Entity updatedEntity, string folderDateTime)
        {
            XDocument resourceDocument  = _resourceElementFactory.HandleResourceUpdate(updatedEntity, folderDateTime);
            string    resourcesBasePath = Path.Combine(_config.ResourcesRootPath, folderDateTime);

            _documentFileHelper.SaveDocument(resourceDocument, resourcesBasePath);

            IntegrationLogger.Write(LogLevel.Debug, "Resources saved, Starting automatic resource import!");

            string baseFilePath    = Path.Combine(_config.ResourcesRootPath, folderDateTime);
            string resourceXmlPath = Path.Combine(baseFilePath, "Resources.xml");

            await _epiApi.ImportResourcesAsync(resourceXmlPath, baseFilePath);

            await _epiApi.NotifyEpiserverPostImportAsync(resourceXmlPath);

            return(true);
        }