Fixed addbulkasync method

This commit is contained in:
Kwoth
2022-03-20 12:19:12 +01:00
parent eab16865cd
commit fd032d3e91

View File

@@ -27,14 +27,12 @@ public class CurrencyService : ICurrencyService, INService
{ {
if (type == CurrencyType.Default) if (type == CurrencyType.Default)
{ {
await using var ctx = _db.GetDbContext();
foreach (var userId in userIds) foreach (var userId in userIds)
{ {
var wallet = new DefaultWallet(userId, ctx); await using var wallet = await GetWalletAsync(userId);
await wallet.Add(amount, txData); await wallet.Add(amount, txData);
} }
await ctx.SaveChangesAsync();
return; return;
} }