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