Exemple #1
0
        public async Task <string> GetAtomStringAsync()
        {
            _feedGenerator.FeedItemCollection = await GetDataAsync();

            var xml = await _feedGenerator.WriteAtomAsync();

            return(xml);
        }
        public async Task <string> GetAtomData()
        {
            var itemCollection = await GetFeedEntriesAsync();

            var rw = new FeedGenerator
            {
                HostUrl            = _baseUrl,
                HeadTitle          = _blogConfig.FeedSettings.RssTitle,
                HeadDescription    = _blogConfig.FeedSettings.RssDescription,
                Copyright          = _blogConfig.FeedSettings.RssCopyright,
                Generator          = $"Moonglade v{Helper.AppVersion}",
                FeedItemCollection = itemCollection,
                TrackBackUrl       = _baseUrl
            };

            var xml = await rw.WriteAtomAsync();

            return(xml);
        }