mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 08:00:16 -04:00
Most services are implemented as command/queries
Code cleanup
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Application.Cryptography.Models;
|
||||
|
||||
namespace ModernKeePass.Application.Cryptography.Queries.GetKeyDerivations
|
||||
{
|
||||
public class GetKeyDerivationsQuery : IRequest<IEnumerable<KeyDerivationVm>>
|
||||
{
|
||||
public class GetKeyDerivationsQueryHandler : IRequestHandler<GetKeyDerivationsQuery, IEnumerable<KeyDerivationVm>>
|
||||
{
|
||||
private readonly ICryptographyClient _cryptography;
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public GetKeyDerivationsQueryHandler(ICryptographyClient cryptography, IMapper mapper)
|
||||
{
|
||||
_cryptography = cryptography;
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public IEnumerable<KeyDerivationVm> Handle(GetKeyDerivationsQuery message)
|
||||
{
|
||||
yield return _mapper.Map<KeyDerivationVm>(_cryptography.KeyDerivations);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user