Skip to content

Cannot Update Title of Page #346

@farukcan

Description

@farukcan

Doesnt work without error:

          var updateParameters = new PagesUpdateParameters{
            Properties = new Dictionary<string, PropertyValue>
                {
                    { "Name", blog.Name.ToTitlePropertyValue() }
                }
          };
          var page = await blogClient.Pages.UpdateAsync(duplicatedTemplateId, updateParameters);

Also doesnt work without error:

          var updateParameters = new PagesUpdateParameters{
            Properties = new Dictionary<string, PropertyValue>
                {
                    { "Title", blog.Name.ToTitlePropertyValue() }
                }
          };
          var page = await blogClient.Pages.UpdateAsync(duplicatedTemplateId, updateParameters);

Static function for fixing bad readibility

        public static TitlePropertyValue ToTitlePropertyValue(this string? text){
            return new TitlePropertyValue(){
                Title = new List<RichTextBase>(){
                    new RichTextText { Text = new Text { Content = text } }
                }
            };
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions