Example #1
0
        private async Task <CustomEntityVersion> CreateDraftIfRequiredAsync(UpdateCustomEntityDraftVersionCommand command, CustomEntityVersion draft)
        {
            if (draft != null)
            {
                return(draft);
            }

            var addDraftCommand = new AddCustomEntityDraftVersionCommand();

            addDraftCommand.CustomEntityId = command.CustomEntityId;
            await _commandExecutor.ExecuteAsync(addDraftCommand);

            return(await GetDraftVersionAsync(command));
        }
Example #2
0
        /// <summary>
        /// Creates a new draft version of a custom entity from the currently published version. If there
        /// isn't a currently published version then an exception will be thrown. An exception is also
        /// thrown if there is already a draft version.
        /// </summary>
        public async Task <int> AddCustomEntityDraftVersionAsync(AddCustomEntityDraftVersionCommand command, IExecutionContext executionContext = null)
        {
            await _commandExecutor.ExecuteAsync(command, executionContext);

            return(command.OutputCustomEntityVersionId);
        }
Example #3
0
        public async Task <int> AddDraftAsync(AddCustomEntityDraftVersionCommand command)
        {
            await ExtendableContentRepository.ExecuteCommandAsync(command);

            return(command.CustomEntityId);
        }