Combining two SyndicationFeeds

后端 未结 6 1566
無奈伤痛
無奈伤痛 2021-02-08 13:05

What\'s a simple way to combine feed and feed2? I want the items from feed2 to be added to feed. Also I want

6条回答
  •  情书的邮戳
    2021-02-08 13:47

            //Executed and Tested :)            
            using (XmlReader reader = XmlReader.Create(strFeed))
            {
                rssData = SyndicationFeed.Load(reader);
                model.BlogFeed = rssData; ;
            }
            using (XmlReader reader = XmlReader.Create(strFeed1))
            {
                rssData1 = SyndicationFeed.Load(reader);
                model.BlogFeed = rssData1;
            }
    
            SyndicationFeed feed3 = new SyndicationFeed(rssData.Items.Union(rssData1.Items));
            model.BlogFeed = feed3;           
            return View(model);
    

提交回复
热议问题