diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-07-03 00:43:34 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-07-03 00:43:43 +0200 |
commit | 257019113200d714d86d22ccab6c18b37cd28283 (patch) | |
tree | 9733af3c1f1d2194d31128301944fbcdcbcdfc01 /MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs | |
parent | Prefetch room info (diff) | |
download | MatrixUtils-257019113200d714d86d22ccab6c18b37cd28283.tar.xz |
Local changes
Diffstat (limited to 'MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs')
-rw-r--r-- | MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs | 18 |
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 |