about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs')
-rw-r--r--MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs18
1 files changed, 16 insertions, 2 deletions
diff --git a/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs b/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs
index 58466c7..e497ee3 100644
--- a/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs
+++ b/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs
@@ -4,9 +4,23 @@ using MatrixRoomUtils.Core.Interfaces.Services;
 namespace MatrixRoomUtils.Web.Classes; 
 
 public class SessionStorageProviderService : IStorageProvider {
-    private readonly ISessionStorageService _sessionStorage;
+    private readonly ISessionStorageService _sessionStorageService;
 
     public SessionStorageProviderService(ISessionStorageService sessionStorage) {
-        _sessionStorage = sessionStorage;
+        _sessionStorageService = sessionStorage;
     }
+    
+    async Task IStorageProvider.SaveAllChildrenAsync<T>(string key, T value) => throw new NotImplementedException();
+
+    async Task<T?> IStorageProvider.LoadAllChildrenAsync<T>(string key) where T : default => throw new NotImplementedException();
+
+    async Task IStorageProvider.SaveObjectAsync<T>(string key, T value) => await _sessionStorageService.SetItemAsync(key, value);
+
+    async Task<T?> IStorageProvider.LoadObjectAsync<T>(string key) where T : default => await _sessionStorageService.GetItemAsync<T>(key);
+
+    async Task<bool> IStorageProvider.ObjectExistsAsync(string key) => await _sessionStorageService.ContainKeyAsync(key);
+
+    async Task<List<string>> IStorageProvider.GetAllKeysAsync() => (await _sessionStorageService.KeysAsync()).ToList();
+
+    async Task IStorageProvider.DeleteObjectAsync(string key) => await _sessionStorageService.RemoveItemAsync(key);
 }
\ No newline at end of file