18 lines
639 B
C#
18 lines
639 B
C#
using ErsatzTV.Core.Interfaces.Repositories;
|
|
|
|
namespace ErsatzTV.Application.Configuration;
|
|
|
|
public class SaveConfigElementByKeyHandler : IRequestHandler<SaveConfigElementByKey, Unit>
|
|
{
|
|
private readonly IConfigElementRepository _configElementRepository;
|
|
|
|
public SaveConfigElementByKeyHandler(IConfigElementRepository configElementRepository) =>
|
|
_configElementRepository = configElementRepository;
|
|
|
|
public async Task<Unit> Handle(SaveConfigElementByKey request, CancellationToken cancellationToken)
|
|
{
|
|
await _configElementRepository.Upsert(request.Key, request.Value);
|
|
return Unit.Default;
|
|
}
|
|
}
|