public SingleContentFeed<Article> Get(int id) { _urlHelper.RouteHelper = Url; var article = _articleService.GetById(id); if (article != null) { if (article.ThumbnailImage != null) { article.ThumbnailImage.Url = _urlHelper.GenerateUrl("GetMediaContentById", new { id = article.ThumbnailImage.Id }); } var articleFeed = new SingleContentFeed<Article>( _urlHelper.GenerateUrl("GetArticleById", new { id = article.Id }), article, _urlHelper, _staticContentLinkService ); return articleFeed; } else { return null; } }
public SingleContentFeed<StaticPage> GetById(int id) { _urlHelper.RouteHelper = Url; var staticPage = _staticPageService.GetById(id); if (staticPage != null) { var contentFeed = new SingleContentFeed<StaticPage>( _urlHelper.GenerateUrl("GetStaticPageById", new { id }), staticPage, _urlHelper, _staticContentLinkService ); return contentFeed; } else { return null; } }