Files
modernkeepass/ModernKeePass.Application/Resources/Queries/GetResourceQuery.cs
Geoffroy BONNEVILLE 903e7649e4 More queries/commands
2020-03-26 15:38:29 +01:00

23 lines
705 B
C#

using MediatR;
using ModernKeePass.Application.Common.Interfaces;
namespace ModernKeePass.Application.Resources.Queries
{
public class GetResourceQuery: IRequest<string>
{
public string Key { get; set; }
public class GetResourceQueryHandler: IRequestHandler<GetResourceQuery, string>
{
private readonly IResourceProxy _resourceProxy;
public GetResourceQueryHandler(IResourceProxy resourceProxy)
{
_resourceProxy = resourceProxy;
}
public string Handle(GetResourceQuery message)
{
return _resourceProxy.GetResourceValue(message.Key);
}
}
}
}