public AdminSettingsModel LoadSettings() { var currentSettings = Store.Items<AdminSettingsModel>().FirstOrDefault(); if (currentSettings == null) { currentSettings = new AdminSettingsModel(); Store.Save(currentSettings); } return currentSettings; }
public bool SaveSettings(AdminSettingsModel settings) { try { var currentSettings = LoadSettings(); Store.Save(settings, currentSettings.Id); } catch (Exception) { return false; } return true; }