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); }
public async Task <int> AddAsync(AddPageCommand command) { await ExtendableContentRepository.ExecuteCommandAsync(command); return(command.OutputPageId); }
public async Task <int> AddPageAsync(AddPageCommand command, IExecutionContext executionContext = null) { await _commandExecutor.ExecuteAsync(command, executionContext); return(command.OutputPageId); }