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
kundan asked 2 weeks 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());
            myItems.Add(myItem);
        }

how will i do it

1 Answers
Best Answer
Fernando answered 2 weeks ago
Your Answer

7 + 5 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com