switched to valuetuples for exhanging tokens
This commit is contained in:
@@ -2,21 +2,23 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ArchiveItemHandler(IValueStore<Item> valueStore,
|
||||
ICache<Item> cache,
|
||||
public class ArchiveItemHandler(IValueStore<Item<(Guid, string)>> valueStore,
|
||||
ICache<Item<(Guid, string)>> cache,
|
||||
IMediator mediator) :
|
||||
INotificationHandler<ArchiveEventArgs<Item>>
|
||||
INotificationHandler<ArchiveEventArgs<Item<(Guid, string)>>>
|
||||
{
|
||||
public async Task Handle(ArchiveEventArgs<Item> args)
|
||||
public async Task Handle(ArchiveEventArgs<Item<(Guid, string)>> args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (valueStore.Value is Item item)
|
||||
if (valueStore.Value is Item<(Guid, string)> item)
|
||||
{
|
||||
if (cache.Contains(item))
|
||||
{
|
||||
(Guid id, string name) = item.Value;
|
||||
|
||||
await mediator.Handle<UpdateEventArgs<(Guid, int)>,
|
||||
bool>(new UpdateEventArgs<(Guid, int)>((item.Id, 2)));
|
||||
bool>(new UpdateEventArgs<(Guid, int)>((id, 2)));
|
||||
|
||||
cache.Remove(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user