diff --git a/src/NadekoBot/Db/Extensions/CurrencyTransactionExtensions.cs b/src/NadekoBot/Db/Extensions/CurrencyTransactionExtensions.cs index 22ff3a3bf..98cabb009 100644 --- a/src/NadekoBot/Db/Extensions/CurrencyTransactionExtensions.cs +++ b/src/NadekoBot/Db/Extensions/CurrencyTransactionExtensions.cs @@ -1,4 +1,5 @@ #nullable disable +using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using NadekoBot.Services.Database.Models; @@ -6,12 +7,14 @@ namespace NadekoBot.Db; public static class CurrencyTransactionExtensions { - public static List GetPageFor(this DbSet set, ulong userId, int page) - => set.AsQueryable() - .AsNoTracking() - .Where(x => x.UserId == userId) - .OrderByDescending(x => x.DateAdded) - .Skip(15 * page) - .Take(15) - .ToList(); + public static Task> GetPageFor( + this DbSet set, + ulong userId, + int page) + => set.ToLinqToDBTable() + .Where(x => x.UserId == userId) + .OrderByDescending(x => x.DateAdded) + .Skip(15 * page) + .Take(15) + .ToListAsyncLinqToDB(); } \ No newline at end of file diff --git a/src/NadekoBot/Modules/Gambling/Gambling.cs b/src/NadekoBot/Modules/Gambling/Gambling.cs index 52103dc48..a1949b9a5 100644 --- a/src/NadekoBot/Modules/Gambling/Gambling.cs +++ b/src/NadekoBot/Modules/Gambling/Gambling.cs @@ -249,7 +249,7 @@ public partial class Gambling : GamblingModule List trs; await using (var uow = _db.GetDbContext()) { - trs = uow.CurrencyTransactions.GetPageFor(userId, page); + trs = await uow.CurrencyTransactions.GetPageFor(userId, page); } var embed = _eb.Create() diff --git a/src/NadekoBot/Modules/Gambling/GamblingConfig.cs b/src/NadekoBot/Modules/Gambling/GamblingConfig.cs index f8f5b4b98..8acc32d82 100644 --- a/src/NadekoBot/Modules/Gambling/GamblingConfig.cs +++ b/src/NadekoBot/Modules/Gambling/GamblingConfig.cs @@ -78,7 +78,7 @@ public class CurrencyConfig [Comment(@"What is the name of the currency")] public string Name { get; set; } = "Nadeko Flower"; - [Comment(@"For how long will the transactions be kept in the database (curtrs) + [Comment(@"For how long (in days) will the transactions be kept in the database (curtrs) Set 0 to disable cleanup (keep transactions forever)")] public int TransactionsLifetime { get; set; } = 0; }