我能找到的唯一一篇文章是Consuming RSS 1.0 (RDF) Feeds in ASP.NET MVC 3。它使用LINQ。无论如何使用lambda表达式吗?在MVC3中有更好的消费方式和RSS提要吗?
这是我的代码:
Imports System
Imports System.Xml
Imports System.ServiceModel
Imports System.ServiceModel.Description
Imports System.ServiceModel.Syndication
Imports System.ServiceModel.Web
Imports System.Collections.ObjectModel
Imports System.Collections.Generic
Public Class RssController
Function GetFeed(url As String) As SyndicationFeed
Dim reader = XmlReader.Create(url)
Dim feed = SyndicationFeed.Load(reader)
Return feed
End Function
Function ShowFeed() As ViewResult
Dim feedUrl = "somefeedurl"
Dim feed = GetFeed(feedUrl)
Return View(feed)
End Function
End Class