mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Moved from EF and SQLite to LiteDB
This commit is contained in:
1 parent
d4dd371a50
commit
66f7dc94c8
57 files changed
+379
-1279
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Storage.Entities;
|
||||
using Artemis.Storage.Repositories.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
@@ -71,20 +70,7 @@ namespace Artemis.Core.Plugins.Models
|
||||
return;
|
||||
|
||||
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
_pluginSettingRepository.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the setting asynchronously
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SaveAsync()
|
||||
{
|
||||
if (!HasChanged)
|
||||
return;
|
||||
|
||||
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
await _pluginSettingRepository.SaveAsync();
|
||||
_pluginSettingRepository.Save(_pluginSettingEntity);
|
||||
}
|
||||
|
||||
public event EventHandler<EventArgs> SettingChanged;
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace Artemis.Core.Plugins.Models
|
||||
{
|
||||
settingEntity = new PluginSettingEntity {Name = name, PluginGuid = _pluginInfo.Guid, Value = JsonConvert.SerializeObject(defaultValue)};
|
||||
_pluginSettingRepository.Add(settingEntity);
|
||||
_pluginSettingRepository.Save();
|
||||
}
|
||||
|
||||
var pluginSetting = new PluginSetting<T>(_pluginInfo, _pluginSettingRepository, settingEntity);
|
||||
|
||||
Reference in new issue
Block a user