Sdl.Web.Mvc/Formats/FeedFormatter.cs
/// <summary>
/// Extracts a syndication feed from a given View Model.
/// </summary>
/// <param name="pageModel">The Page Model to extract the feed from.</param>
/// <returns>The extracted syndication feed.</returns>
Extracts a syndication feed from a given View Model.
Extracts a syndication feed from a given View Model .
protected SyndicationFeed ExtractSyndicationFeed(PageModel pageModel)
        {
            if (pageModel == null)
            {
                return null;
            }
            string description = null;
            if (pageModel.Meta != null)
            {
                pageModel.Meta.TryGetValue("description", out description);
            }
            string feedAlternateLink = GetPageUrlWithoutFormatParameter();
            return new SyndicationFeed(pageModel.Title, description, new Uri(feedAlternateLink))
            {
                Language = WebRequestContext.Localization.Culture,
                Items = pageModel.ExtractSyndicationFeedItems(WebRequestContext.Localization)
            };
        }
protected SyndicationFeed ExtractSyndicationFeed ( PageModel pageModel ) { if ( pageModel == null ) { return null ; } string description = null ; if ( pageModel . Meta != null ) { pageModel . Meta . TryGetValue ( " " , out description ) ; } string feedAlternateLink = GetPageUrlWithoutFormatParameter ( ) ; return new SyndicationFeed ( pageModel . Title , description , new Uri ( feedAlternateLink ) ) { Language = WebRequestContext . Localization . Culture , Items = pageModel . ExtractSyndicationFeedItems ( WebRequestContext . Localization ) } ; }
Extracts a syndication feed from a given View Model.
Extracts a syndication feed from a given View Model .
The extracted syndication feed.
The extracted syndication feed .
pageModel
PageModel
The Page Model to extract the feed from.
The Page Model to extract the feed from .