JsonDB/JsonDB.cs
2024-08-12 12:02:12 +09:00

39 lines
626 B
C#

using DevJsonDB.IO;
namespace DevJsonDB;
public class JsonDB<T> : IDisposable
{
private IStore<T> store;
public JsonDB(IStore<T> store)
{
this.store = store;
}
public void Dispose()
{
this.store.Dispose();
}
public void Commit()
{
this.store.Commit();
}
public bool Add(T item)
{
return this.store.Add(item);
}
public IEnumerable<T> GetValues()
{
return this.store.GetValues();
}
public IEnumerable<T> GetValues(Func<T, bool> filter)
{
return this.store.GetValues().Where(filter).ToList();
}
}