23 lines
601 B
C#
23 lines
601 B
C#
using ModVersionChecker.managers.interfaces;
|
|
using ModVersionChecker.model;
|
|
|
|
namespace ModVersionChecker.managers.litedb
|
|
{
|
|
public class ConfigLiteDb : LiteDb, IConfigRepository
|
|
{
|
|
protected override string collection => LiteDb.CONFIG_COLLECTION;
|
|
public Config Load()
|
|
{
|
|
return GetCollection<Config>().FindAll().FirstOrDefault() ?? new Config();
|
|
}
|
|
public void Save(Config config)
|
|
{
|
|
GetCollection<Config>().Upsert(config);
|
|
}
|
|
public Config GetConfig()
|
|
{
|
|
return Load();
|
|
}
|
|
}
|
|
}
|