From 0e764a59d5009c67af40e8a4902ad3c9d28645db Mon Sep 17 00:00:00 2001
From: Lucca Santangelo <luccasant95@gmail.com>
Date: Sat, 21 Nov 2020 18:38:18 -0300
Subject: [PATCH] GetPosts order by desc Date

---
 Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs b/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs
index 0d625f4..795c771 100644
--- a/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs
+++ b/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs
@@ -67,6 +67,7 @@ namespace Tsi1.BusinessLayer.Services
 
             var posts = await _context.Posts
                 .Where(x => x.ForumId == forumId)
+                .OrderByDescending(x => x.Date)
                 .ToListAsync();
 
             var postDtos = _mapper.Map<List<PostPreviewDto>>(posts);
-- 
GitLab