mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
29 lines
843 B
C#
29 lines
843 B
C#
using MediatR;
|
|
using ModernKeePass.Application.Common.Interfaces;
|
|
using ModernKeePass.Application.Group.Models;
|
|
using ModernKeePass.Domain.Exceptions;
|
|
|
|
namespace ModernKeePass.Application.Group.Commands.SortEntries
|
|
{
|
|
public class SortEntriesCommand : IRequest
|
|
{
|
|
public GroupVm Group { get; set; }
|
|
|
|
public class SortEntriesCommandHandler : IRequestHandler<SortEntriesCommand>
|
|
{
|
|
private readonly IDatabaseProxy _database;
|
|
|
|
public SortEntriesCommandHandler(IDatabaseProxy database)
|
|
{
|
|
_database = database;
|
|
}
|
|
|
|
public void Handle(SortEntriesCommand message)
|
|
{
|
|
if (!_database.IsOpen) throw new DatabaseClosedException();
|
|
|
|
_database.SortEntries(message.Group.Id);
|
|
}
|
|
}
|
|
}
|
|
} |