Browse Source

Blog module comment and reply orders

pull/441/head
Yunus Emre Kalkan 8 years ago
parent
commit
5a6c50b90e
  1. 8
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Comments/CommentAppService.cs

8
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Comments/CommentAppService.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Services;
@ -39,6 +40,13 @@ namespace Volo.Blogging.Comments
}
}
hierarchicalComments = hierarchicalComments.OrderByDescending(c => c.Comment.CreationTime).ToList();
foreach (var hierarchicalComment in hierarchicalComments)
{
hierarchicalComment.Replies = hierarchicalComment.Replies.OrderBy(c => c.CreationTime).ToList();
}
return hierarchicalComments;
}

Loading…
Cancel
Save