2020-03-26 19:04:51 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using MediatR;
|
|
|
|
|
using ModernKeePass.Application.Common.Interfaces;
|
|
|
|
|
|
2020-03-30 19:43:04 +02:00
|
|
|
|
namespace ModernKeePass.Application.Parameters.Queries.GetCompressions
|
2020-03-26 19:04:51 +01:00
|
|
|
|
{
|
|
|
|
|
public class GetCompressionsQuery : IRequest<IEnumerable<string>>
|
|
|
|
|
{
|
|
|
|
|
public class GetCompressionsQueryHandler : IRequestHandler<GetCompressionsQuery, IEnumerable<string>>
|
|
|
|
|
{
|
|
|
|
|
private readonly ICryptographyClient _cryptography;
|
|
|
|
|
|
|
|
|
|
public GetCompressionsQueryHandler(ICryptographyClient cryptography)
|
|
|
|
|
{
|
|
|
|
|
_cryptography = cryptography;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<string> Handle(GetCompressionsQuery message)
|
|
|
|
|
{
|
|
|
|
|
return _cryptography.CompressionAlgorithms.OrderBy(c => c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|