Support unarchiving

This commit is contained in:
TheXamlGuy
2024-05-19 16:13:45 +01:00
parent 77084b015b
commit a2323f6d3e
24 changed files with 267 additions and 128 deletions
+40
View File
@@ -0,0 +1,40 @@
using Bitvault.Data;
using Microsoft.EntityFrameworkCore;
using Toolkit.Foundation;
namespace Bitvault;
public class EditItemHander(IDbContextFactory<ContainerDbContext> dbContextFactory) :
IHandler<EditEventArgs<(int, ItemConfiguration)>, bool>
{
public async Task<bool> Handle(EditEventArgs<(int, ItemConfiguration)> args,
CancellationToken cancellationToken)
{
//if (args.Value is ItemConfiguration configuration)
//{
// try
// {
// using ContainerDbContext context = dbContextFactory.CreateDbContext();
// EntityEntry<ItemEntry>? result = null;
// await Task.Run(async () =>
// {
// result = await context.AddAsync(new ItemEntry { Name = configuration.Name }, cancellationToken);
// await context.SaveChangesAsync(cancellationToken);
// }, cancellationToken);
// if (result is not null)
// {
// return true;
// }
// }
// catch
// {
// }
//}
return false;
}
}