feat: watchlist repository, remove ef core from all bot code

This commit is contained in:
sam 2024-10-28 02:14:41 +01:00
parent da4dfae27c
commit f0511a560c
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
19 changed files with 155 additions and 97 deletions

View file

@ -53,14 +53,4 @@ public static class QueryExtensions
throw new CataloggerError("Guild not found, was not initialized during guild create");
return guild;
}
public static async Task<Watchlist?> GetWatchlistEntryAsync(
this DatabaseContext db,
Snowflake guildId,
Snowflake userId,
CancellationToken ct = default
) =>
await db
.Watchlists.AsNoTracking()
.FirstOrDefaultAsync(w => w.GuildId == guildId.Value && w.UserId == userId.Value, ct);
}