예제 #1
0
        private AddPageCommand MapCommand(DuplicatePageCommand command, PageQuery toDup)
        {
            EntityNotFoundException.ThrowIfNull(toDup, command.PageToDuplicateId);

            var addPageCommand = new AddPageCommand();

            addPageCommand.ShowInSiteMap        = !toDup.Version.ExcludeFromSitemap;
            addPageCommand.PageTemplateId       = toDup.Version.PageTemplateId;
            addPageCommand.MetaDescription      = toDup.Version.MetaDescription;
            addPageCommand.OpenGraphDescription = toDup.Version.OpenGraphDescription;
            addPageCommand.OpenGraphImageId     = toDup.Version.OpenGraphImageId;
            addPageCommand.OpenGraphTitle       = toDup.Version.OpenGraphTitle;
            addPageCommand.PageType             = (PageType)toDup.PageTypeId;

            addPageCommand.Title    = command.Title;
            addPageCommand.LocaleId = command.LocaleId;
            addPageCommand.UrlPath  = command.UrlPath;
            addPageCommand.CustomEntityRoutingRule = command.CustomEntityRoutingRule;
            addPageCommand.PageDirectoryId         = command.PageDirectoryId;

            addPageCommand.Tags = toDup.Tags.ToArray();

            return(addPageCommand);
        }
예제 #2
0
        public async Task <int> AddAsync(AddPageCommand command)
        {
            await ExtendableContentRepository.ExecuteCommandAsync(command);

            return(command.OutputPageId);
        }
예제 #3
0
        public async Task <int> AddPageAsync(AddPageCommand command, IExecutionContext executionContext = null)
        {
            await _commandExecutor.ExecuteAsync(command, executionContext);

            return(command.OutputPageId);
        }