Beispiel #1
0
        public Feed GetLatestFeed()
        {
            var feedData = _feedRepository.GetLatestFeedData();

            if (feedData == null)
            {
                return(null);
            }

            var serializer = new XmlSerializer(typeof(Feed), Ns);
            var ms         = new MemoryStream(feedData.FeedBytes);

            return(serializer.Deserialize(ms) as Feed);
        }
Beispiel #2
0
        public Feed GetLatestFeed(string siteHost)
        {
            FeedData feedData = _feedRepository.GetLatestFeedData(siteHost);

            if (feedData == null)
            {
                return(null);
            }

            var serializer = new XmlSerializer(typeof(Feed), Ns);

            using (var ms = new MemoryStream(feedData.FeedBytes))
            {
                return(serializer.Deserialize(ms) as Feed);
            }
        }