From 7901638726f42627052df7c4a509c6a3e8ea3bc3 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 25 Jun 2018 14:17:39 +0300 Subject: [PATCH] blog post creation time --- .../Volo/Blogging/Posts/PostDto.cs | 2 ++ .../src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml | 4 +++- .../src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostDto.cs index 9c85bc7859..a8d5e2c126 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostDto.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/PostDto.cs @@ -10,5 +10,7 @@ namespace Volo.Blogging.Posts public string Title { get; protected set; } public string Content { get; set; } + + public DateTime CreationTime { get; set; } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml index 9273622bba..ab76fff180 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml @@ -6,4 +6,6 @@

@Model.Post.Title

-

@Model.Post.Content

\ No newline at end of file +

@Model.Post.Content

+ +Posted to @Model.Blog.Name On @Model.Post.CreationTime \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs index f0f262ea60..bfc49ccb31 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs @@ -22,6 +22,8 @@ namespace Volo.Blogging.Pages.Blog.Posts public PostDto Post { get; set; } + public BlogDto Blog { get; set; } + public DetailModel(IPostAppService postAppService, IBlogAppService blogAppService) { _postAppService = postAppService; @@ -32,7 +34,8 @@ namespace Volo.Blogging.Pages.Blog.Posts { var blog = await _blogAppService.GetByShortNameAsync(BlogShortName); - Post = await _postAppService.GetPost(new GetPostInput(){BlogId = blog.Id , Title = PostTitle}); + Post = await _postAppService.GetPost(new GetPostInput {BlogId = blog.Id , Title = PostTitle}); + Blog = blog; } } } \ No newline at end of file