mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 08:00:16 -04:00
More queries/commands
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user