using Wallet.Data; using Microsoft.EntityFrameworkCore; using System.Threading; using Toolkit.Foundation; namespace Wallet; public class UnarchiveItemHandler(IDecoratorService> decoratorService, IDbContextFactory dbContextFactory) : INotificationHandler> { public async Task Handle(UnarchiveEventArgs args) { try { if (decoratorService.Service is Item<(Guid, string)> item) { (Guid id, string name) = item.Value; using WalletContext context = await dbContextFactory.CreateDbContextAsync(); if (await context.FindAsync(id) is ItemEntry result) { result.State = 0; await context.SaveChangesAsync(); } } } catch { } } }