How do I call the repository on my methods? I am trying to save my returned item from the repository with my method by the RSS reader method
public square stores & lt; T & gt; : IRAPSorgetry & Lt; T & gt; Where T: Class, IERTTI {Protected XmlHandler & lt; T & gt; YoloHandler = New XmlHandler & lt; T & gt; (); Save public Zero (list & lt; T & gt; value, string path) {try {YoloHandler.SaveXml (value, path); } Catch (Exceptional Exceptions) {New Non Imulated Exposition (); }}}}
This method requires me to call, so I can use it in my method which gives syndication feed to:
< Code> public class RSS reader: IReader {public list & lt; FeedItem & gt; Read (string url) {list & lt; FeedItem & gt; RSSflow = new list & lt; FeedItem & gt; (); XmlReader Reader = XmlReader.Create (url); Syndication feed = syndication feed Load (reader); Reader.Close (); Var FeedItam = New Feed Item (); Foreign currency (syndication item item in feed) {feedItem.Title = item.Title.Text; Forresh (link in feed) {feedItem.Link = link.Uri.ToString (); } Try {RssFlow.Add (feedItem); } Catch (exception) {}} return RSS flow; }}
How to use the save method from my repository and how to save the list returned from that method?
Good, it is very simple:
var repo = new Repository & lt; FeedItem & gt; (); Repo Save (rssflow, "path to save");
Comments
Post a Comment