示例#1
0
 public UpdatePageDirectoryCommand MapFromAddCommand(AddPageDirectoryCommand command)
 {
     return(new UpdatePageDirectoryCommand()
     {
         PageDirectoryId = command.OutputPageDirectoryId,
         Name = command.Name
     });
 }
 public UpdatePageDirectoryUrlCommand MapFromAddCommand(AddPageDirectoryCommand command)
 {
     return(new UpdatePageDirectoryUrlCommand()
     {
         PageDirectoryId = command.OutputPageDirectoryId,
         ParentPageDirectoryId = command.ParentPageDirectoryId,
         UrlPath = command.UrlPath
     });
 }
        /// <summary>
        /// Creates a valid <see cref="AddPageDirectoryCommand"/> that is
        /// parented to the specified <paramref name="parentDirectoryId"/>.
        /// </summary>
        /// <param name="uniqueData">
        /// Unique data to use in creating the Name and UrlSlug property.
        /// </param>
        /// <param name="parentDirectoryId">
        /// The database id of the page directory to use as the parent
        /// directory.
        /// </param>
        public AddPageDirectoryCommand CreateAddCommand(string uniqueData, int parentDirectoryId)
        {
            var command = new AddPageDirectoryCommand()
            {
                Name = uniqueData,
                ParentPageDirectoryId = parentDirectoryId,
                UrlPath = SlugFormatter.ToSlug(uniqueData)
            };

            return(command);
        }
 public Task <JsonResult> Post([FromBody] AddPageDirectoryCommand command)
 {
     return(_apiResponseHelper.RunCommandAsync(command));
 }
示例#5
0
 public async Task <IActionResult> Post([FromBody] AddPageDirectoryCommand command)
 {
     return(await _apiResponseHelper.RunCommandAsync(this, command));
 }
示例#6
0
        public async Task <int> AddAsync(AddPageDirectoryCommand command)
        {
            await ExtendableContentRepository.ExecuteCommandAsync(command);

            return(command.OutputPageDirectoryId);
        }