aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/TimelinePostService.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 20:14:55 +0800
committerGitHub <noreply@github.com>2021-01-07 20:14:55 +0800
commite02871ff8bba7fccebdaaeea29141ed5e3289c09 (patch)
tree67128b91d6cfd08c54c9e745e7bf2abbdf1f20f4 /BackEnd/Timeline/Services/TimelinePostService.cs
parent5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d (diff)
parentffe44ba70c9e5c6a01179c7e2f4185543cbc441c (diff)
downloadtimeline-e02871ff8bba7fccebdaaeea29141ed5e3289c09.tar.gz
timeline-e02871ff8bba7fccebdaaeea29141ed5e3289c09.tar.bz2
timeline-e02871ff8bba7fccebdaaeea29141ed5e3289c09.zip
Merge pull request #203 from crupest/back-dev
refactor: Make mapper a service. Fix #202.
Diffstat (limited to 'BackEnd/Timeline/Services/TimelinePostService.cs')
-rw-r--r--BackEnd/Timeline/Services/TimelinePostService.cs9
1 files changed, 2 insertions, 7 deletions
diff --git a/BackEnd/Timeline/Services/TimelinePostService.cs b/BackEnd/Timeline/Services/TimelinePostService.cs
index 9f0fd550..a8bdbf92 100644
--- a/BackEnd/Timeline/Services/TimelinePostService.cs
+++ b/BackEnd/Timeline/Services/TimelinePostService.cs
@@ -3,7 +3,6 @@ using Microsoft.Extensions.Logging;
using SixLabors.ImageSharp;
using System;
using System.Collections.Generic;
-using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Timeline.Entities;
@@ -166,12 +165,12 @@ namespace Timeline.Services
if (modifiedSince.HasValue)
{
- query = query.Include(p => p.Author).Where(p => p.LastUpdated >= modifiedSince || (p.Author != null && p.Author.UsernameChangeTime >= modifiedSince));
+ query = query.Where(p => p.LastUpdated >= modifiedSince || (p.Author != null && p.Author.UsernameChangeTime >= modifiedSince));
}
query = query.OrderBy(p => p.Time);
- return await query.Include(p => p.Author!.Permissions).ToListAsync();
+ return await query.ToListAsync();
}
public async Task<string> GetPostDataETag(long timelineId, long postId)
@@ -270,8 +269,6 @@ namespace Timeline.Services
_database.TimelinePosts.Add(postEntity);
await _database.SaveChangesAsync();
- await _database.Entry(postEntity).Reference(p => p.Author).Query().Include(a => a.Permissions).LoadAsync();
-
return postEntity;
}
@@ -313,8 +310,6 @@ namespace Timeline.Services
_database.TimelinePosts.Add(postEntity);
await _database.SaveChangesAsync();
- await _database.Entry(postEntity).Reference(p => p.Author).Query().Include(a => a.Permissions).LoadAsync();
-
return postEntity;
}