예제 #1
0
        private async Task <List <Post> > FillPostsWithContent(IEnumerable <Post> posts, BlogModel model)
        {
            return((await Task.WhenAll(posts.Select(x => FillPostWithContent(x, model)))).ToList());

            async Task <Post> FillPostWithContent(Post post, BlogModel metaModel)
            {
                var content = (await _store.GetContentByFilename(post.Filename)).ExcludeHeader();
                var result  = new Post(post)
                {
                    Content = await _engine.ProcessTemplateAsync(post.Filename, content, metaModel)
                };

                return(result);
            }
        }