about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-07-03 00:43:34 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-07-03 00:43:43 +0200
commit257019113200d714d86d22ccab6c18b37cd28283 (patch)
tree9733af3c1f1d2194d31128301944fbcdcbcdfc01 /MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs
parentPrefetch room info (diff)
downloadMatrixUtils-257019113200d714d86d22ccab6c18b37cd28283.tar.xz
Local changes
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