Example #1
0
        public List<Article> GetArticlesFromBlog(string blogOwner, string blogName)
        {
            List<Article> articles = new List<Article>();
            Blog blog = new Blog(blogOwner, blogName);
            BusinessManagement.Article art = new BusinessManagement.Article();

            if (!blog.Exists)
                return articles;

            blog.GetArticles().ForEach(item =>
            {
                Dbo.Article dboArt = BusinessManagement.Article.GetArticleDbo(item.Id);
                articles.Add(ConvertToWebArticle(dboArt));
            });

            return articles;
        }
Example #2
0
        public Article GetArticleFromBlog(string blogOwner, string blogName, long articleId)
        {
            Blog blog = new Blog(blogOwner, blogName);

            if (!blog.Exists)
                return null;

            List<DataAccess.T_Article> articles = blog.GetArticles();

            foreach (DataAccess.T_Article art in articles)
            {
                if (art.Id != articleId || blog.Id != art.BlogId)
                    continue;
                return ConvertToWebArticle(BusinessManagement.Article.GetArticleDbo(art.Id));
            };

            return null;
        }