await usings and minor cleanup

This commit is contained in:
Kwoth
2021-12-20 03:02:02 +01:00
parent 1b2017024c
commit da2ee0c158
55 changed files with 176 additions and 174 deletions

View File

@@ -32,7 +32,6 @@ public class FeedsService : INService
.AsQueryable()
.Where(x => guildConfigIds.Contains(x.Id))
.Include(x => x.FeedSubs)
.ThenInclude(x => x.GuildConfig)
.ToList()
.SelectMany(x => x.FeedSubs)
.GroupBy(x => x.Url.ToLower())

View File

@@ -339,7 +339,7 @@ public sealed class StreamNotificationService : INService
public async Task<int> ClearAllStreams(ulong guildId)
{
using var uow = _db.GetDbContext();
await using var uow = _db.GetDbContext();
var gc = uow.GuildConfigsForId(guildId, set => set.Include(x => x.FollowedStreams));
uow.RemoveRange(gc.FollowedStreams);
@@ -354,7 +354,7 @@ public sealed class StreamNotificationService : INService
public async Task<FollowedStream> UnfollowStreamAsync(ulong guildId, int index)
{
FollowedStream fs;
using (var uow = _db.GetDbContext())
await using (var uow = _db.GetDbContext())
{
var fss = uow.Set<FollowedStream>()
.AsQueryable()
@@ -400,7 +400,7 @@ public sealed class StreamNotificationService : INService
return null;
FollowedStream fs;
using (var uow = _db.GetDbContext())
await using (var uow = _db.GetDbContext())
{
var gc = uow.GuildConfigsForId(guildId, set => set.Include(x => x.FollowedStreams));