Mass rename project for rebranding

This commit is contained in:
TheXamlGuy
2024-06-09 14:00:36 +01:00
parent 1f777e19cd
commit 45712d0a70
241 changed files with 310 additions and 366 deletions
+28
View File
@@ -0,0 +1,28 @@
using Wallet.Data;
using Microsoft.EntityFrameworkCore;
using Toolkit.Foundation;
namespace Wallet;
public class UpdateItemStateHandler(IDbContextFactory<WalletContext> dbContextFactory) :
IHandler<UpdateEventArgs<(Guid, int)>, bool>
{
public async Task<bool> Handle(UpdateEventArgs<(Guid, int)> args,
CancellationToken cancellationToken)
{
if (args.Value is (Guid id, int state))
{
await Task.Run(async () =>
{
using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken);
if (await context.FindAsync<ItemEntry>(id) is ItemEntry result)
{
result.State = state;
await context.SaveChangesAsync();
}
}, cancellationToken);
}
return false;
}
}