Ejemplo n.º 1
0
        public IEnumerable <forGet> SelectAllUserPublishedPostsAndTags()
        {
            IEnumerable <forGet> results = from p in postDal.GetPublishedPosts()
                                           join pM in postsTagsMapDal.GetPostsTagsMap()
                                           on p.Id equals pM.PostId
                                           join t in tagDal.GetAllTags() on
                                           pM.TagId equals t.Id
                                           join u in userDal.GetAllUsers() on
                                           p.AuthorId equals u.Id
                                           select new forGet {
                post = p, tag = t, user = u
            };

            foreach (var p in results)
            {
                p.post.tags.Add(p.tag);
            }
            logger.Trace("Success");
            return(results);
        }
Ejemplo n.º 2
0
 public IEnumerable <Tag> GetAllTags(string orderBy = null, string where = null)
 {
     logger.Trace("Success");
     return(tagDal.GetAllTags(orderBy, where));
 }