diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationAutoMapperProfile.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationAutoMapperProfile.cs index 2d40c7fad9..b2113926ad 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationAutoMapperProfile.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationAutoMapperProfile.cs @@ -22,14 +22,10 @@ namespace Volo.Blogging CreateMap(); CreateMap().Ignore(x=>x.Writer).Ignore(x=>x.CommentCount).Ignore(x=>x.Tags); CreateMap() - .Ignore(x=>x.LastModificationTime) - .Ignore(x=>x.LastModifierId) - .Ignore(x=>x.DeleterId) - .Ignore(x=>x.IsDeleted) - .Ignore(x=>x.DeletionTime) - .Ignore(x=>x.CommentCount) - .Ignore(x=>x.Tags); - + .IgnoreModificationAuditedObjectProperties() + .IgnoreDeletionAuditedObjectProperties() + .Ignore(x => x.CommentCount) + .Ignore(x => x.Tags); } } } diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index 9e8acba57d..d804e7a004 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -209,9 +209,7 @@ namespace Volo.Blogging.Posts { var posts = await _postRepository.GetOrderedList(blogId); - var postCacheItems = ObjectMapper.Map, List>(posts); - - return postCacheItems; + return ObjectMapper.Map, List>(posts); } private async Task RenameUrlIfItAlreadyExistAsync(Guid blogId, string url, Post existingPost = null) diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostCacheItem.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostCacheItem.cs index f08424aaf1..450feec9dd 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostCacheItem.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostCacheItem.cs @@ -9,9 +9,10 @@ using Volo.Blogging.Users; namespace Volo.Blogging.Posts { [Serializable] - public class PostCacheItem + public class PostCacheItem : ICreationAuditedObject { public Guid Id { get; set; } + public Guid BlogId { get; set; } public string Title { get; set; } @@ -32,8 +33,9 @@ namespace Volo.Blogging.Posts public BlogUser Writer { get; set; } public List Tags { get; set; } - public Guid? CreatorId { get; set; } + public Guid? CreatorId { get; set; } + public DateTime CreationTime { get; set; } } } \ No newline at end of file