Beispiel #1
0
        /// <inheritdoc />
        public async Task CreateUpdateAsync(SettingDto settingDto)
        {
            SettingEntity settingEntity = await _settingsRepository.GetByTypeAsync(settingDto.Type);

            if (settingEntity == null)
            {
                settingEntity = _mapper.Map <SettingEntity>(settingDto);
                await _settingsRepository.CreateAsync(settingEntity);
            }
            else
            {
                _mapper.Map(settingDto, settingEntity);
                await _settingsRepository.UpdateAsync(settingEntity);
            }
        }