private AddCustomEntityCommand MapCommand(DuplicateCustomEntityCommand command, CustomEntityVersion customEntityVersionToDuplicate)
        {
            EntityNotFoundException.ThrowIfNull(customEntityVersionToDuplicate, command.CustomEntityToDuplicateId);

            var addPageCommand = new AddCustomEntityCommand();

            addPageCommand.Title    = command.Title;
            addPageCommand.LocaleId = command.LocaleId;
            addPageCommand.UrlSlug  = command.UrlSlug;
            addPageCommand.CustomEntityDefinitionCode = customEntityVersionToDuplicate.CustomEntity.CustomEntityDefinitionCode;
            addPageCommand.Model = _customEntityDataModelMapper.Map(addPageCommand.CustomEntityDefinitionCode, customEntityVersionToDuplicate.SerializedData);

            return(addPageCommand);
        }
        public async Task <int> AddAsync(AddCustomEntityCommand command)
        {
            await ExtendableContentRepository.ExecuteCommandAsync(command);

            return(command.OutputCustomEntityId);
        }
Example #3
0
        public async Task <int> AddCustomEntityAsync(AddCustomEntityCommand command, IExecutionContext executionContext = null)
        {
            await _commandExecutor.ExecuteAsync(command, executionContext);

            return(command.OutputCustomEntityId);
        }