mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
WIP change to ids
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Application.Group.Models;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Group.Commands.DeleteGroup
|
||||
{
|
||||
public class DeleteGroupCommand : IRequest
|
||||
{
|
||||
public GroupVm Group { get; set; }
|
||||
|
||||
public class DeleteGroupCommandHandler : IAsyncRequestHandler<DeleteGroupCommand>
|
||||
{
|
||||
private readonly IDatabaseProxy _database;
|
||||
|
||||
public DeleteGroupCommandHandler(IDatabaseProxy database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
public async Task Handle(DeleteGroupCommand message)
|
||||
{
|
||||
if (!_database.IsOpen) throw new DatabaseClosedException();
|
||||
|
||||
await _database.DeleteGroup(message.Group.Id);
|
||||
message.Group = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user