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)); }
/// <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); }
public async Task <int> AddDraftAsync(AddCustomEntityDraftVersionCommand command) { await ExtendableContentRepository.ExecuteCommandAsync(command); return(command.CustomEntityId); }