Esempio n. 1
0
 public CommentsViewModel Execute(CommentsInputModel inputModel)
 {
   return new CommentsViewModel
   {
     Comments = _session.Query<CommentViewModel>()
         .Where(x => x.ArticleUri.Equals(inputModel.Uri))
         .OrderByDescending(x => x.PublishedDate)
   };
 }
Esempio n. 2
0
        public CommentsViewModel Execute(CommentsInputModel inputModel)
        {
            var comments = _database
                           .Query <Comment>()
                           .Where(x => x.ArticleUri.Equals(inputModel.Uri))
                           .OrderByDescending(x => x.PublishedDate)
                           .ToList();

            return(new CommentsViewModel
            {
                Uri = inputModel.Uri,
                Comments = comments.Select(x => x.DynamicMap <CommentViewModel>())
            });
        }