public static PostModel ToPostModel(this BlogPostPageViewModel blogPostPageViewModel, PostEntity postEntity)
 {
     var postModel = new PostModel
         {
             Post = postEntity,
             DisqusEnabled = blogPostPageViewModel.DisqusEnabled
         };
     return postModel;
 }
Exemple #2
0
        private static List<PostModel> GetPostList(List<PostEntity> postList, ISettings settingsRepository, string rUrl)
        {
            var disqusEnabled = settingsRepository.DisqusEnabled;
            var rootUrl = rUrl.TrimEnd('/');

            var postModeList = new List<PostModel>();

            postList.ForEach(post =>
            {
                var postModel = new PostModel { Post = post, RootUrl = rootUrl, DisqusEnabled = disqusEnabled };
                postModeList.Add(postModel);
            });

            return postModeList;
        }