public AppSettings Load() { try { var data = storage.Get(settingsFilename); if (data == null) { var defaultSettings = CreateDefaultSettings(); Save(defaultSettings); return(defaultSettings); } return(serializer.Deserialize <AppSettings>(data)); } catch (Exception e) { MessageBox.Show(e.Message, "Не удалось загрузить настройки"); return(CreateDefaultSettings()); } }
public AppSettings Load() { try { settingsFilename = "app.settings"; var data = storage.Get(settingsFilename); if (data == null) { var defaultSettings = CreateDefaultSettings(); Save(defaultSettings); return(defaultSettings); } return(serializer.Deserialize <AppSettings>(data)); } catch (Exception e) { MessageBox.Show(e.Message, "Error occured"); return(CreateDefaultSettings()); } }
public IActionResult Get(string id) { return(Ok(_repo.Get(id, "Blob").Result)); }
public Task <T> ViewModel <T>(Guid userId) { return(_blobStorage.Get <T>(typeof(T).Name + "#" + userId)); }
public async Task <IActionResult> Get(string id) { var result = await _storage.Get(id); return(Ok(result)); }