Try to search your question here, if you can't find : Ask Any Question Now ?

how to create rss content encode c# with SyndicationItem

HomeCategory: stackoverflowhow to create rss content encode c# with SyndicationItem
Avatarkundan asked 3 months ago

i want to generate an xml feed like below in which description and content need to be in tag like and

List<SyndicationItem> myItems = new List<SyndicationItem>();
        foreach (TestViewModel testViewModel in rssViewModel.Test)
            SyndicationItem myItem = new SyndicationItem
                                             Title = new TextSyndicationContent(articleViewModel.ArticleTitle)

            myItem.AddPermalink(new Uri(articleViewModel.ArticleUrl));
            myItem.Id = articleViewModel.ArticleUrl;
            myItem.ElementExtensions.Add(new XElement("pubDate", articleViewModel.PublishedDate).CreateReader());
            foreach (ArticleAuthorViewModel articleAuthorViewModel in articleViewModel.Authors)
                myItem.ElementExtensions.Add(new XElement("author", articleAuthorViewModel.FullName).CreateReader());
            myItem.ElementExtensions.Add(new XElement("description", string.Format("<![CDATA[{0}]]>", articleViewModel.Abstract)).CreateReader());
            myItem.ElementExtensions.Add(new XElement("content", string.Format("<![CDATA[{0}]]>", articleViewModel.Body)).CreateReader());

how will i do it

1 Answers
Best Answer
AvatarFernando answered 3 months ago
Your Answer

1 + 4 =

Popular Tags

WP Facebook Auto Publish Powered By :