コード例 #1
0
        /// <summary>
        /// If the url slug is autogenerated, we need to update it only when the custom entity is published.
        /// </summary>
        private async Task UpdateUrlSlugIfRequired(CustomEntityVersion dbVersion, ICustomEntityDefinition definition)
        {
            if (!definition.AutoGenerateUrlSlug)
            {
                return;
            }

            var urlCommand = new UpdateCustomEntityUrlCommand()
            {
                CustomEntityId = dbVersion.CustomEntityId,
                LocaleId       = dbVersion.CustomEntity.LocaleId,
                UrlSlug        = SlugFormatter.ToSlug(dbVersion.Title)
            };

            await _commandExecutor.ExecuteAsync(urlCommand);
        }
 public Task UpdateUrlAsync(UpdateCustomEntityUrlCommand command)
 {
     return(ExtendableContentRepository.ExecuteCommandAsync(command));
 }
コード例 #3
0
 public Task UpdateCustomEntityUrlAsync(UpdateCustomEntityUrlCommand command, IExecutionContext executionContext = null)
 {
     return(_commandExecutor.ExecuteAsync(command, executionContext));
 }