Esempio n. 1
0
        public async Task <SetSettingResult> Handle(SetSettingRequest request, CancellationToken cancellationToken)
        {
            var settingExists = (await _settingRepository.GetSetting(request.Name) != null);

            if (settingExists)
            {
                await _settingRepository.UpdateSetting(request.Name, request.Value);

                return(SetSettingResult.Updated);
            }

            await _settingRepository.CreateSetting(request.Name, request.Value);

            return(SetSettingResult.Created);
        }