This commit is contained in:
TheXamlGuy
2024-06-15 14:24:30 +01:00
parent 85998cde35
commit 61213b00e7
15 changed files with 33 additions and 43 deletions
+2 -3
View File
@@ -1,14 +1,13 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using Toolkit.Foundation;
using Wallet.Data;
namespace Wallet;
public class CountCategoriesHandler(IDbContextFactory<WalletContext> dbContextFactory) :
IHandler<CountEventArgs<ItemCategory>, IReadOnlyCollection<(string, int)>>
IHandler<CountEventArgs<Item>, IReadOnlyCollection<(string, int)>>
{
public async Task<IReadOnlyCollection<(string, int)>> Handle(CountEventArgs<ItemCategory> args,
public async Task<IReadOnlyCollection<(string, int)>> Handle(CountEventArgs<Item> args,
CancellationToken cancellationToken)
{
using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken);