コード例 #1
0
ファイル: GetHandler.cs プロジェクト: mtscout6/FubuMVC.Blog
 public CommentsViewModel Execute(CommentsInputModel inputModel)
 {
   return new CommentsViewModel
   {
     Comments = _session.Query<CommentViewModel>()
         .Where(x => x.ArticleUri.Equals(inputModel.Uri))
         .OrderByDescending(x => x.PublishedDate)
   };
 }
コード例 #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>())
            });
        }