about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/Interfaces/Services
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-06-19 02:36:32 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-06-19 02:36:32 +0200
commited2205972a7b7d6fdd4563c3775a83616920597a (patch)
tree54aec1cfdf861fd8a7739be131fbe79ae24d91e4 /MatrixRoomUtils.Core/Interfaces/Services
parentPartial refactor (diff)
downloadMatrixUtils-ed2205972a7b7d6fdd4563c3775a83616920597a.tar.xz
Working sync
Diffstat (limited to 'MatrixRoomUtils.Core/Interfaces/Services')
-rw-r--r--MatrixRoomUtils.Core/Interfaces/Services/IStorageProvider.cs39
1 files changed, 34 insertions, 5 deletions
diff --git a/MatrixRoomUtils.Core/Interfaces/Services/IStorageProvider.cs b/MatrixRoomUtils.Core/Interfaces/Services/IStorageProvider.cs

index 2540ad7..01314da 100644 --- a/MatrixRoomUtils.Core/Interfaces/Services/IStorageProvider.cs +++ b/MatrixRoomUtils.Core/Interfaces/Services/IStorageProvider.cs
@@ -1,17 +1,46 @@ namespace MatrixRoomUtils.Core.Interfaces.Services; public interface IStorageProvider { - // save - public async Task SaveAll() { - Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement Save()!"); + // save all children of a type with reflection + public Task SaveAllChildren<T>(string key, T value) { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement SaveAllChildren<T>(key, value)!"); + return Task.CompletedTask; } + + // load all children of a type with reflection + public Task<T?> LoadAllChildren<T>(string key) { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement LoadAllChildren<T>(key)!"); + return Task.FromResult(default(T)); + } + - public async Task SaveObject<T>(string key, T value) { + public Task SaveObject<T>(string key, T value) { Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement SaveObject<T>(key, value)!"); + return Task.CompletedTask; + } + + // load + public Task<T?> LoadObject<T>(string key) { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement LoadObject<T>(key)!"); + return Task.FromResult(default(T)); + } + + // check if exists + public Task<bool> ObjectExists(string key) { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement ObjectExists(key)!"); + return Task.FromResult(false); + } + + // get all keys + public Task<List<string>> GetAllKeys() { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement GetAllKeys()!"); + return Task.FromResult(new List<string>()); } + // delete - public async Task DeleteObject(string key) { + public Task DeleteObject(string key) { Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement DeleteObject(key)!"); + return Task.CompletedTask; } } \ No newline at end of file