Exemplo n.º 1
0
        public async Task CommitEditAsync(IPageEdit editSession, CancellationToken cancellationToken = default)
        {
            if (editSession == null)
            {
                throw new ArgumentNullException(nameof(editSession));
            }

            var page = await pageService.FindPageByIdAsync(editSession.PageId);

            var pageMetadata = await pageService.GetPageTypeAsync(page);

            var newContentData = await editSessionRepository.GetContentAsync(editSession);

            var pageContentModel = pageMetadata.ContentMetadata.ConvertDictionaryToContentModel(newContentData);

            await pageService.SetPageContentAsync(page, pageContentModel);

            await editSessionRepository.DeleteEditAsync(editSession, cancellationToken);
        }