From 6fc1822b8631be72a4ef24a71fa5d8ac918fd782 Mon Sep 17 00:00:00 2001
From: esantangelo <enzo020895@gmail.com>
Date: Tue, 24 Nov 2020 21:36:29 -0300
Subject: [PATCH] add ToList

---
 Tsi1.Api/Tsi1.BusinessLayer/Services/PostMessageService.cs | 2 +-
 Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tsi1.Api/Tsi1.BusinessLayer/Services/PostMessageService.cs b/Tsi1.Api/Tsi1.BusinessLayer/Services/PostMessageService.cs
index 626f981..7d7431f 100644
--- a/Tsi1.Api/Tsi1.BusinessLayer/Services/PostMessageService.cs
+++ b/Tsi1.Api/Tsi1.BusinessLayer/Services/PostMessageService.cs
@@ -72,7 +72,7 @@ namespace Tsi1.BusinessLayer.Services
 
             var postMessageDtos = _mapper.Map<List<PostMessagePreviewDto>>(postMessages);
 
-            var userIds = postMessageDtos.Select(x => x.UserId);
+            var userIds = postMessageDtos.Select(x => x.UserId).ToList();
 
             var users = await _context.Users.Where(x => userIds.Contains(x.Id)).ToListAsync();
 
diff --git a/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs b/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs
index d039f7e..5c52e39 100644
--- a/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs
+++ b/Tsi1.Api/Tsi1.BusinessLayer/Services/PostService.cs
@@ -72,7 +72,7 @@ namespace Tsi1.BusinessLayer.Services
 
             var postDtos = _mapper.Map<List<PostPreviewDto>>(posts);
 
-            var userIds = postDtos.Select(x => x.UserId);
+            var userIds = postDtos.Select(x => x.UserId).ToList();
 
             var users = await _context.Users.Where(x => userIds.Contains(x.Id)).ToListAsync();
 
-- 
GitLab