It it now possible to create/edit item contents

This commit is contained in:
TheXamlGuy
2024-06-06 20:42:23 +01:00
parent 1302145f1c
commit c399e8c05c
30 changed files with 331 additions and 180 deletions
+8 -10
View File
@@ -1,5 +1,6 @@
using Bitvault.Data;
using Microsoft.EntityFrameworkCore;
using System.Threading;
using Toolkit.Foundation;
namespace Bitvault;
@@ -12,19 +13,16 @@ public class UnarchiveItemHandler(IDecoratorService<Item<(Guid, string)>> decora
{
try
{
if (decoratorService.Value is Item<(Guid, string)> item)
if (decoratorService.Service 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<ItemEntry>(id) is ItemEntry result)
{
result.State = 0;
await context.SaveChangesAsync();
}
});
using LockerContext context = await dbContextFactory.CreateDbContextAsync();
if (await context.FindAsync<ItemEntry>(id) is ItemEntry result)
{
result.State = 0;
await context.SaveChangesAsync();
}
}
}
catch