Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Add custom element in Syndication Item or AtomEntry is impossible  #48

@MTerance

Description

@MTerance

Unlike in the exemple RssWriteItemWithCustomElementExample.cs,
AtomEntry and SindicationItem inherit from ISyndicationItem.

when i want to add a custom element like a balise <enclosure> in my element <entry>,
after passing the formatter , my new elemnt is not displayed in the result :

                var item = new AtomEntry
                {
                    Title = post.Title,
                    Description = post.Content,
                    Id = $"{host}/posts/{post.Slug}",
                    Published = post.Published,
                    LastUpdated = post.Published,
                    ContentType = "html",
                };

item.AddContributor(new SyndicationPerson(post.Author.DisplayName, post.Author.Email));
                item.AddLink(new SyndicationLink(new Uri(item.Id)));

var content = new SyndicationContent(_formatter.Format(item));
content.AddField(new SyndicationContent("enclosure",  "linkToMyMp3.mp3"));


In the displayed result , the element enclosure created earlier is missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions