private void ConfigureAesSettings() { Setting aesKeySetting; Setting aesIVSetting; using (var aes = Aes.Create()) { aesKeySetting = new Setting() { SettingKey = AES_KEY, SettingValue = Convert.ToBase64String(aes.Key) }; aesIVSetting = new Setting() { SettingKey = AES_IV, SettingValue = Convert.ToBase64String(aes.IV) }; _aesKey = new byte[aes.Key.Length]; _aesIV = new byte[aes.IV.Length]; Array.Copy(aes.Key, _aesKey, _aesKey.Length); Array.Copy(aes.IV, _aesIV, _aesIV.Length); } _settingsRepository.Create(aesKeySetting); _settingsRepository.Create(aesIVSetting); }
public void CreateAssetSetting([FromBody] Settings assetSetting) { _settingsRepo.Create(assetSetting); _settingsRepo.Save(); }
public void Create(SettingsDto model) { _settingsRepository.Create(_mapper.Map <Settings>(model)); _settingsRepository.SaveChanges(); }
public void CreateSettings(TSetting setting) { _settingsRepository.Create(setting); }