Example #1
0
        public IActionResult GetPost(string postid, string username, string password)
        {
            var post = BlogRepository.GetAll(Blog.Id).FirstOrDefault(p => p.PostId == postid);

            var info = new
                    {
                        description = post.Content,
                        title = post.Title,
                        dateCreated = post.PubDate,
                        wp_slug = post.Slug,
                        categories = post.Categories.ToArray(),
                        mt_keywords = post.Keywords,
                        postid = post.PostId,
                        mt_excerpt = post.Excerpt
                    };

            return new XmlRpcResult(info);
        }
Example #2
0
        public IActionResult GetRecentPosts(string blogid, string username, string password, int numberOfPosts)
        {
            List<object> list = new List<object>();

            foreach (var post in BlogRepository.GetAll(blogid).Take(numberOfPosts))
            {
                var info = new
                            {
                                description = post.Content,
                                title = post.Title,
                                dateCreated = post.PubDate,
                                wp_slug = post.Slug,
                                postid = post.PostId
                            };

                list.Add(info);
            }

            return new XmlRpcResult(list.ToArray());
        }
Example #3
0
 public IActionResult GetUsersBlogs(string key, string username, string password)
 {
     var blogs =  new[]
                     {
                         new
                         {
                             blogid = Blog.Id,
                             blogName = Blog.Title,
                             url = Blog.Url
                         }
                     };
     return new XmlRpcResult(blogs);
 }