public IActionResult Index(string link = @"https://www.espn.com/espn/rss/news") { RSSChannelModel rssChanel = _httpWorker.GetRSSChanel(link); ViewData["Link"] = link; return(View(rssChanel)); }
private RSSChannelModel SerializeXML(string xml) { XmlSerializer serializer = new XmlSerializer(typeof(RSSChannelModel)); RSSChannelModel rssChannel = new RSSChannelModel(); try { rssChannel = (RSSChannelModel)serializer.Deserialize(new StringReader(xml)); } catch { rssChannel.NewsArray = new NewsModel[0]; rssChannel.httpWorkerError = HTTPWorkerError.InvalidRSSXML; } return(rssChannel); }