Most services are implemented as command/queries

Code cleanup
This commit is contained in:
Geoffroy BONNEVILLE
2020-03-26 19:04:51 +01:00
parent 903e7649e4
commit 22072bb2fe
46 changed files with 567 additions and 390 deletions

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using System.Linq;
using MediatR;
using ModernKeePass.Application.Common.Interfaces;
namespace ModernKeePass.Application.Cryptography.Queries.GetCompressions
{
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);
}
}
}
}