using System.Collections.Generic; using System.Linq; using MediatR; using ModernKeePass.Application.Common.Interfaces; using ModernKeePass.Application.Parameters.Models; namespace ModernKeePass.Application.Parameters.Queries.GetCiphers { public class GetCiphersQuery: IRequest> { public class GetCiphersQueryHandler: IRequestHandler> { private readonly ICryptographyClient _cryptography; public GetCiphersQueryHandler(ICryptographyClient cryptography) { _cryptography = cryptography; } public IEnumerable Handle(GetCiphersQuery message) { return _cryptography.Ciphers.Select(c => new CipherVm { Id = c.Id, Name = c.Name }); } } } }