BgEngine.Controllers.PostController.RssFeed C# (CSharp) Method

RssFeed() public method

Subscribe the latest post in this website
public RssFeed ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult
        public ActionResult RssFeed()
        {
            bool ispremium;
            if ((CodeFirstSecurity.IsAuthenticated) && (CodeFirstRoleServices.IsUserInRole(CodeFirstSecurity.CurrentUserName, BgResources.Security_PremiumRole)))
            {
                ispremium = true;
            }
            else
            {
                ispremium = false;
            }
            var postItems = BlogServices.FindRSSPosts(ispremium, 20)
                .Select(p => new SyndicationItem(p.Title, p.Description, new Uri(Url.AbsoluteAction("GetPostByCode", "Post", new { id = p.Code })))
                {
                    PublishDate = new DateTimeOffset(p.DateCreated),
                    Copyright = new TextSyndicationContent(BgResources.Messages_Copyright),
                });
            var feed = new SyndicationFeed(String.Format(Resources.AppMessages.Rss_Latest_Post_Title,BgResources.Messages_SiteTitle), Resources.AppMessages.Rss_Latest_Post_Description, new Uri(Url.AbsoluteAction("NewPosts", "Post")), postItems);
            return new FeedResult(new Rss20FeedFormatter(feed));
        }