Example #1
0
        public ICollection <PostModel> GetPosts(int categoryId)
        {
            var queryResult = _categoryService.GetCategoryPosts(categoryId.ToString());

            List <PostModel> posts = new List <PostModel>();

            foreach (var post in queryResult)
            {
                posts.Add(new PostModel {
                    Id = post.Id, Subject = post.Subject, SentAt = post.SentAt, SentBy = post.SentBy
                });
            }

            return(posts);
        }