public bool RemoveData <T>(string key) where T : class { if (SettingsBrokerInstances.All(s => s.Key != key)) { throw new NotSupportedException("Item does not exists"); } return(SettingsBrokerInstances.Remove(SettingsBrokerInstances.FirstOrDefault(s => s.Key == key))); }
public T GetData <T>(string key) where T : class { if (SettingsBrokerInstances.All(s => s.Key != key)) { return(default(T)); } return(SettingsBrokerInstances.FirstOrDefault(s => key == s.Key).Value as T); }