using System.Threading; using System.Threading.Tasks; using ErsatzTV.Core.Interfaces.Repositories; using LanguageExt; namespace ErsatzTV.Application.Configuration.Commands { public class SaveConfigElementByKeyHandler : MediatR.IRequestHandler { private readonly IConfigElementRepository _configElementRepository; public SaveConfigElementByKeyHandler(IConfigElementRepository configElementRepository) => _configElementRepository = configElementRepository; public async Task Handle(SaveConfigElementByKey request, CancellationToken cancellationToken) { await _configElementRepository.Upsert(request.Key, request.Value); return Unit.Default; } } }