Files
modernkeepass/ModernKeePass.Application/Settings/Commands/PutSettingCommand.cs
Geoffroy BONNEVILLE 22072bb2fe Most services are implemented as command/queries
Code cleanup
2020-03-26 19:04:51 +01:00

25 lines
743 B
C#

using MediatR;
using ModernKeePass.Application.Common.Interfaces;
namespace ModernKeePass.Application.Settings.Commands
{
public class PutSettingCommand<T> : IRequest
{
public string Key { get; set; }
public T value { get; set; }
public class PutSettingCommandHandler : IRequestHandler<PutSettingCommand<T>>
{
private readonly ISettingsProxy _settingsProxy;
public PutSettingCommandHandler(ISettingsProxy settingsProxy)
{
_settingsProxy = settingsProxy;
}
public void Handle(PutSettingCommand<T> message)
{
_settingsProxy.PutSetting(message.Key, message.value);
}
}
}
}